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

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.

主站蜘蛛池模板: 湘阴县| 徐闻县| 壤塘县| 万宁市| 湖口县| 西盟| 大连市| 汝南县| 安西县| 祥云县| 兴隆县| 新泰市| 荃湾区| 平度市| 梁山县| 资源县| 蕲春县| 文昌市| 恩施市| 龙口市| 泗洪县| 阳原县| 河南省| 哈尔滨市| 徐州市| 新闻| 大足县| 邵武市| 石城县| 确山县| 岳阳县| 高尔夫| 昌宁县| 临颍县| 通辽市| 华坪县| 石台县| 扶风县| 凤冈县| 山东| 东平县|