- Hands-On Ensemble Learning with R
- Prabhanjan Narayanachar Tattar
- 147字
- 2021-07-23 19:10:52
Na?ve Bayes classifier
The na?ve Bayes classifier is a simplistic implementation based on the Bayes formula. It is based on simple empirical and conditional probabilities, as evidenced in the actual data. Beyond the simplest assumption of observation independence, we don't have any restrictions in using this model.
Na?ve Bayes for hypothyroid classification
A na?ve Bayes classifier is fit using the naiveBayes
function from the e1071
R package. The prediction and accuracy assessment is carried out using two functions, predict
and sum
:
> NB_fit <- naiveBayes(HT2_Formula,data=HT2_Train) > NB_predict <- predict(NB_fit,newdata=HT2_TestX) Warning message: In data.matrix(newdata) : NAs introduced by coercion > NB_Accuracy <- sum(NB_predict==HT2_TestY)/nte > NB_Accuracy [1] 0.9732704403
The accuracy of the na?ve Bayes classifier is 97.33%, which is the same as the logistic regression model and less than the one provided by the neural network. We remark here that it is only a coincidence that the accuracy of this method and logistic regression is the same.
推薦閱讀
- HBase Design Patterns
- VMware Performance and Capacity Management(Second Edition)
- CorelDRAW X4中文版平面設計50例
- AWS Administration Cookbook
- Hybrid Cloud for Architects
- 步步圖解自動化綜合技能
- 軟件構件技術
- 電氣控制與PLC原理及應用(歐姆龍機型)
- Machine Learning Algorithms(Second Edition)
- 計算機組成與操作系統
- Artificial Intelligence By Example
- 大數據導論
- 工業機器人入門實用教程
- 智能小車機器人制作大全(第2版)
- 工業機器人技術