朴素贝叶斯法
朴素贝叶斯算法
输入:训练数据 T = { ( x 1 , y 1 ) , ( x 2 , y 2 , ( x 3 , y 3 ) , ⋅ ⋅ ⋅ , ( x N , y N ) } T=\lbrace (x_1,y_1),(x_2,y_2,(x_3,y_3),···,(x_N,y_N)\rbrace T={ (x1,y1),(x2,y2,(x3,y3),⋅⋅⋅,(xN,yN)},其中 x i = ( x i ( 1 ) , x i ( 2 ) , x i ( 3 ) , ⋅ ⋅ ⋅ , x i ( n ) ) T x_{i}=(x_{i}^{(1)},x_{i}^{(2)},x_{i}^{(3)},···,x_{i}^{(n)})^T xi=(xi(1),xi(2),xi(3),⋅⋅⋅,xi(n))T是第
i i i个样本的第 j j j个特征。 x i ( j ) ∈ { a j 1 , a j 2 , a j 3 , ⋅ ⋅ ⋅ , a j S j } x_i^{(j)}\in\{a_{j1},a_{j2},a_{j3},···,a_{jS_{j}}\} xi(j)∈{ aj1,aj2,aj3,⋅⋅⋅,ajSj