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

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.

主站蜘蛛池模板: 高台县| 施甸县| 桦川县| 灵丘县| 兴化市| 临澧县| 鹤山市| 东明县| 通城县| 中牟县| 南靖县| 醴陵市| 宜丰县| 清丰县| 达拉特旗| 沁源县| 玉溪市| 柘城县| 大丰市| 平阴县| 香港 | 泗水县| 勐海县| 萨嘎县| 汉沽区| 黑水县| 松阳县| 武胜县| 鹿泉市| 上蔡县| 海丰县| 辉南县| 辉南县| 通榆县| 宁陵县| 渭源县| 缙云县| 四会市| 永仁县| 保亭| 巴林左旗|