c++ - Multinomial Naive Bayes for OpenCV -
i'm looking multinomial naive bayes classifier written in c/c++ use opencv.
i'm looking algorithm (or readymade implementation) more helpful i'm trying understand on how works?
naive bayes classifier well-known classification algorithm. in field of text classification, take explaining.
assuming have training document {d1 , d2 , d3 , ... , dm} each document can represented collection of words {w1,w2,w3, ... , wn} , each document belongs predefined set of class (take binary case (c_0,c_1) here) our task classify new input document d either class c_0 or class c_1.
an intuitive way take maximum likelihood estimation: is,
output c_0 if p(d | c_0) > p(d | c_1) , vice versa. so our definition of d, can write criterion by
p(d | c_0) = p( {w1,w2,w3...,wn} | c_0) since calculating joint probability given class complicated. make strong assumption words mutually independent conditioned on class. leads
p(d | c_0) = p({w1,w2,w3...,wn} | c_0) = p(w1|c_0)*p(w2|c_0)*p(w2|c_0)...*p(wn|c_0) where each p(w | c) can computed frequency count of word w in class c.
this strong assumption reason name "naive", since naively series multiplication each word.
finally taking answer = argmax p(d | c_0) , p(d | c_1) end algorithm
i guess in domain you're looking similar text classification, except feature need extract different.
Comments
Post a Comment