Close Menu
    Trending
    • Musk’s X appoints ‘king of virality’ in bid to boost growth
    • Why Entrepreneurs Should Stop Obsessing Over Growth
    • Implementing IBCS rules in Power BI
    • What comes next for AI copyright lawsuits?
    • Why PDF Extraction Still Feels LikeHack
    • GenAI Will Fuel People’s Jobs, Not Replace Them. Here’s Why
    • Millions of websites to get ‘game-changing’ AI bot blocker
    • I Worked Through Labor, My Wedding and Burnout — For What?
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»機器學習複習系列(8)-朴素貝葉斯. 貝葉斯演算法(Bayesian… | by Hsu Jerry | Apr, 2025
    Machine Learning

    機器學習複習系列(8)-朴素貝葉斯. 貝葉斯演算法(Bayesian… | by Hsu Jerry | Apr, 2025

    Team_AIBS NewsBy Team_AIBS NewsApril 25, 2025No Comments1 Min Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    貝葉斯演算法(Bayesian Algorithms)是一種以機率為基礎的推論方式,能夠結合先驗知識與觀察數據來進行預測與分類。

    貝葉斯定理(Bayes’ Theorem)

    貝葉斯演算法的核心是貝葉斯定理,它描述了在已知某事件發生的條件下,另一事件的機率如何更新。公式如下:

    • A:你想要判斷的事件(例如:某人有沒有某種疾病)。
    • B:你觀察到的資料(例如:檢驗結果是陽性)。
    • P(A):先驗機率(Prior),事件 A 在尚未觀察到 B 前的機率。
    • P(B∣A):似然度(Probability),在 A 發生的前提下觀察到 B 的機率。
    • P(B):邊際機率:觀察到 B 的總體機率。
    • P(A∣B):後驗機率(Posterior):在 B 發生之後,A 發生的機率。

    例子:

    • 全部有 1000 個人,其中只有 10 人有某種疾病(先驗機率 P(病)=0.01)
    • 現在有一種檢驗法,如果你有病,有 99% 機會會驗出陽性(似然度 P(陽性∣病)=0.99)
    • 但這個檢驗也會誤報 5% 的健康人(誤報率 P(陽性∣無病)=0.05)

    那麼某人驗出陽性後,他真的得病的機率是多少?

    根據貝葉斯定理:

    即使驗出陽性,只有約 16.7% 的機會真的得病。

    例子2:

    在輸入法或搜尋引擎中,使用者有時會輸入拼錯的單字(例如打成 “tlp”),這個單字不在字典中,我們的目標是猜測使用者真正想輸入的單字是什麼?

    這就變成一個條件機率問題:
    我們想知道,在觀察到拼錯單詞 D的情況下,每個可能的正確單詞 h的機率 P(h∣D)。

    P(D∣h)=在本想輸入單詞 h 的情況下,實際輸入成 D 的機率

    • 正確單詞 h=high、tip,我們不曉得哪個才是正確單詞,錯誤輸入則是 D=tlp

    假設打錯的原因可以用以下「編輯操作」來表示:

    越接近的按鍵越容易誤觸!假設使用者打的是 tlp,我們懷疑他原本想打的是 high 或 tip。那我們要比較:

    假設鍵盤鄰接距離定義中,o 鄰近 l → 替換機率設為 0.1,其他字母誤打為非鄰近鍵 → 替換機率設為 0.01

    情況一、假設使用者原本想輸入 high,實際卻輸入 tlp,則每個字母的替換機率:

    情況二、設使用者原本想輸入 high,實際卻輸入 tip,則每個字母的替換機率:

    結論:系統應該猜 high。

    第二種方法,假設有一份紀錄表

    以最大似然估計計算似然度 P(D∣h):

    搭配先驗機率(假設來自語料詞頻)P(high)=0.02,P(tip)=0.01:

    結論:系統應該猜 high。



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleRobot Videos: Cargo Robots, Robot Marathons, and More
    Next Article A Step-By-Step Guide To Powering Your Application With LLMs
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Why PDF Extraction Still Feels LikeHack

    July 1, 2025
    Machine Learning

    🚗 Predicting Car Purchase Amounts with Neural Networks in Keras (with Code & Dataset) | by Smruti Ranjan Nayak | Jul, 2025

    July 1, 2025
    Machine Learning

    Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Musk’s X appoints ‘king of virality’ in bid to boost growth

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    Robot Videos: Cargo Robots, Robot Marathons, and More

    April 25, 2025

    TikTok Fined $600 Million for Sending European User Data to China

    May 2, 2025

    Top 10 Technologies of 2025 That Will Change Your Life Forever | by Sohail Dogar | Feb, 2025

    February 19, 2025
    Our Picks

    Musk’s X appoints ‘king of virality’ in bid to boost growth

    July 1, 2025

    Why Entrepreneurs Should Stop Obsessing Over Growth

    July 1, 2025

    Implementing IBCS rules in Power BI

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.