官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 宁津县| 宜章县| 成武县| 西乌| 顺义区| 高雄县| 吉林市| 上虞市| 慈利县| 邢台市| 土默特左旗| 陆良县| 江门市| 宜黄县| 交口县| 绵竹市| 高唐县| 沂南县| 睢宁县| 寻甸| 富蕴县| 鲁甸县| 武冈市| 乐平市| 南开区| 周口市| 金秀| 偃师市| 隆德县| 嵊州市| 兴安县| 东宁县| 南皮县| 东明县| 凤冈县| 阿城市| 湘潭市| 弋阳县| 京山县| 布拖县| 徐水县|