/DL-BayesTheorem

[2019][Python/ Bayes / Naive Bayes Classifier]

Primary LanguagePython

[Bayes' Theorem]

[Reference]

1. What Is Naive Bayes?

  • Naive Bayes is among one of the simplest,
  • but most powerful algorithms for classification based on [Bayes' Theorem] with an assumption of independence among predictors

2. 现实生活中有什么用?

  • 同样的,在现实世界中,我们每个人都需要预测。想要深入分析未来、思考是否买股票、政策给自己带来哪些机遇、提出新产品构想,或者只是计划一周的饭菜。
  • 贝叶斯定理就是为了解决这些问题而诞生的,它可以根据过去的数据来预测出概率。
  • Spam Filtering
  • Medical Diagnosis
  • Weather Prediction

3. What Is Bayes' Theorem?

  • In statistics and probability theory, Bayes' theorem describes the probability of an event, based on prior knowledge of conditions that might be related to the event. It serves as a way to figure out conditional probability.

  • 更好理解图

  • 全概率公式

  • 条件概率另一种写法

  • 推导记录

在这里,如果"可能性函数"P(B|A)/P(B)>1,意味着"先验概率"被增强,事件A的发生的可能性变大;如果"可能性函数"=1,意味着B事件无助于判断事件A的可能性;如果"可能性函数" 小于1, 意味着"先验概率"被削弱,事件A的可能性变小。

4. 例子

5. Naive Bayes Classifier

[Reference]

特征值分类, 预测概率
  cd /NaiveBayesClassifier
  python main.py