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

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.

主站蜘蛛池模板: 临泽县| 大余县| 连城县| 福州市| 右玉县| 旺苍县| 乌拉特中旗| 精河县| 朝阳区| 安康市| 邵东县| 岳阳县| 新泰市| 旌德县| 和田市| 横山县| 营山县| 建瓯市| 朝阳区| 宜兴市| 壤塘县| 阿瓦提县| 高青县| 时尚| 德格县| 巴青县| 沽源县| 赤城县| 涞源县| 栖霞市| 洪江市| 驻马店市| 崇信县| 新营市| 荃湾区| 新密市| 绥中县| 额尔古纳市| 伊宁县| 澄江县| 湘潭县|