楼主: hanszhu
2081 0

Bayesian classifiers in Mahout [推广有奖]

  • 0关注
  • 34粉丝

院士

26%

还不是VIP/贵宾

-

TA的文库  其他...

Clojure NewOccidental

Job and Interview

Perl资源总汇

威望
7
论坛币
144575016 个
通用积分
71.5575
学术水平
37 点
热心指数
38 点
信用等级
25 点
经验
23228 点
帖子
1869
精华
1
在线时间
796 小时
注册时间
2005-1-3
最后登录
2024-4-23

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Mahout currently has two implementations of Bayesian classifiers.  One is the traditional Naive Bayes approach, and the other is called Complementary Naive Bayes.
ImplementationsNaiveBayes (MAHOUT-9)
Complementary Naive Bayes (MAHOUT-60)
The Naive Bayes implementations in Mahout follow the paperhttp://people.csail.mit.edu/jrennie/papers/icml03-nb.pdf Before we get to the actual algorithm lets discuss the terminology
Given, in an input set of classified documents:
  • j = 0 to N features
  • k = 0 to L labels
Then:
  • Normalized Frequency for a term(feature) in a document is calculated by dividing the term frequency by the root mean square of terms frequencies in that document
  • Weight Normalized Tf for a given feature in a given label = sum of Normalized Frequency of the feature across all the documents in the label.
  • Weight Normalized Tf-Idf for a given feature in a label is the Tf-idf calculated using standard idf multiplied by the Weight Normalized Tf
Once Weight Normalized Tf-idf(W-N-Tf-idf) is calculated, the final weight matrix for Bayes and Cbayes are calculated as follows
We calculate the sum of W-N-Tf-idf for all the features in a label called as Sigma_k or sumLabelWeight
For Bayes
Weight = Log [ ( W-N-Tf-Idf + alpha_i ) / ( Sigma_k + N  ) ]

For CBayes
We calculate the Sum of W-N-Tf-Idf across all labels for a given feature. We call this sumFeatureWeight of Sigma_j
Also we sum the entire W-N-Tf-Idf weights for all feature,label pair in the train set. Call this Sigma_jSigma_k
Final Weight is calculated as
Weight = Log [ ( Sigma_j - W-N-Tf-Idf + alpha_i ) / ( Sigma_jSigma_k - Sigma_k + N  ) ]

ExamplesIn Mahout's example code, there are two samples that can be used:
        
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:classifiers classifier Bayesian mahout Bayes currently called start

本帖被以下文库推荐

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-26 15:58