[Stay Sharp]Naive Bayes Algorithm

The Naive Bayes Algorithm

P \left( Y = c _ { k } | X = x \right) = \frac { P \left( Y = c _ { k } \right) \prod _ { j } P \left( X ^ { ( j ) } = x ^ { ( j ) } | Y = c _ { k } \right) } { \sum _ { k } P \left( Y = c _ { k } \right) \prod _ { j } P \left( X ^ { ( j ) } = x ^ { ( j ) } | Y = c _ { k } \right) }
Note: the features of input are independent to each other.

The algorithm is based on the Bayes Theorem.

image.png

The Naive Bayes Classifier

A Naive Bayes Classifier use the algorithm to predict a output class value according to a set of set of attributes.

For loop [each know class value] {
    step 1. calculate probabilities of each attribute under the condition of class value.
    step 2. get the joint conditional probability of all the attributes of the input.
    step 3. calculate the conditional probabilities of the class value.
}
The class with the highest conditional probability wins.
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容