机器学习朴素贝叶斯算法_机器学习中的朴素贝叶斯算法
機器學習樸素貝葉斯算法
樸素貝葉斯算法 (Naive Bayes Algorithm)
Naive Bayes is basically used for text learning. Using this algorithm we trained machine from text.
樸素貝葉斯基本上用于文本學習。 使用此算法,我們從文本中訓練了機器。
Let’s understand it with an example:
讓我們通過一個例子來理解它:
Question:
題:
There are two writers SARA and CHRIS .The probability of writing the word "LOVE" ,"DEAL" and "LIFE" is 0.1,0.8 and 0.1 respectively by CHRIS and 0.5,0.2 and 0.3 by SARA. The probability of sending mail by CHRIS and SARA is 0.5, and then answer this question:
SARA和CHRIS有兩個作者。CHRIS的單詞“ LOVE”,“ DEAL”和“ LIFE”的書寫概率分別為SARA和0.5、0.2和0.3,分別為0.1,0.8和0.1。 CHRIS和SARA發送郵件的概率為0.5,然后回答以下問題:
Who will more likely send the mail "LOVE LIFE"?
誰更有可能發送郵件“ LOVE LIFE”?
What is the probability that "LOVE LIFE" is send by CHRIS?
CHRIS發送“ LOVE LIFE”的可能性是多少?
Solution:
解:
Ans 1)
答1)
P(CHRIS,"LOVE LIFE")=P(CHRIS) *P("LOVE LIFE"|CHRIS)= 0.5 * (0.1 *0.1) =0.005 P(SARA,"LOVE LIFE")=P(SARA) * P("LOVE LIFE"|SARA)= 0.5 * (0.5 * 0.3)= 0.075Hence, SARA is more likely to send mail "LOVE LIFE".Ans 2)
答2)
Normalize:P("LOVE LIFE")=P(CHRIS,"LOVE LIFE")+P(SARA,"LOVE LIFE")= 0.005+0.075= 0.08 Probability of sending mail "LOVE LIFE" by CHRIS (P(CHRIS|"LOVE LIFE"))= P(CHRIS,"LOVE LIFE")/P("LOVE LIFE")= 0.005/0.08= 0.0625
Similarly for probability of sending mail by SARA we can divide 0.075 by the total of two i.e. 0.08.
同樣,對于通過SARA發送郵件的可能性,我們可以將0.075除以2的總和,即0.08。
HENCE THIS PROCESS IS THE ALGORITHM FOR BAYES RULE.
因此,此過程是貝葉斯規則的算法。
翻譯自: https://www.includehelp.com/ml-ai/naive-bayes-algorithm.aspx
機器學習樸素貝葉斯算法
總結
以上是生活随笔為你收集整理的机器学习朴素贝叶斯算法_机器学习中的朴素贝叶斯算法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: containsall_Java Vec
- 下一篇: as_hash ruby_Ruby中带有