机器学习训练营——机器学习爱好者的自由交流空间(入群联系qq:2279055353)
Naive Bayes
方法是一组有监督学习算法,它根据贝叶斯(Bayes)理论,并假设每一对特征之间是独立的。给定特征向量 x1,…,xnx_1, \dots, x_nx1,…,xn 和类变量 yyy, Bayes理论阐明下面的关系:
P(y∣x1,…,xn)=p(y)p(x1,…,xn∣y)p(x1,…,xn)\mathcal{P}(y | x_1, \dots, x_n)=\frac{\mathcal{p}(y)\mathcal{p}(x_1, \dots, x_n | y)}{\mathcal{p}(x_1, \dots, x_n)}P(y∣x1,…,xn)=p(x1,…,xn)p(y)p(x1,…,xn∣y)
使用Naive独立性假设
P(xi∣y,x1,…,xi−1,xi+1,…,xn)=P(xi∣y)\mathcal{P}(x_i | y, x_1, \dots, x_{i-1}, x_{i+1}, \dots, x_n)=\mathcal{P}(x_i | y)P(xi∣y,x1,…,xi−1,xi+1,…,xn)=P(xi∣y)
这样,Bayes公式可以简化