0

Given that I may have an ARFF file that is written in the following form:

@relation spamOrNot
@attribute body String
@attribute result {spam, notspam}
"free money now!", spam
"hi meet me at 10", notspam

And I were to run this to train a Naive Bayes Classifier on Weka. How would I create a test-set so that this trained classifier would be able to make predictions? Thanks.

4

1 回答 1

1

有许多数据存储库,您可以在其中找到垃圾邮件和非垃圾邮件示例(来自现实生活)。然后,获取垃圾邮件/非垃圾邮件的正文并制作一个类似的 arff 文件(但这次它将测试 arff 文件),并带有适当的标签(垃圾邮件正文为垃圾邮件,非垃圾邮件正文为 notspam )。使用您的训练 arff 文件,您将获得一个分类器模型。保存该模型。然后在 Weka 资源管理器分类选项卡上,选择单选按钮“测试集”并选择您的测试集(尽管它会有标签)。然后加载您的训练模型,右键单击它,然后选择使用测试集重新评估。你完成了。

于 2012-03-20T01:15:44.313 回答