我正在尝试使用 weka 和朴素贝叶斯分类器对一些网络帖子进行分类。
首先,我手动分类了许多帖子(大约 100 个负数和 100 个正数),并使用以下形式创建了一个 .arff 文件:
@relation classtest
@attribute 'post' string
@attribute 'class' {positive,negative}
@data
'RT @burnreporter: Google has now indexed over 30 trillion URLs. Wow. #LeWeb',positive
'A special one for me Soundcloud at #LeWeb ',positive
'RT @dianaurban: Lost Internet for 1/2 hour at a conference called #LeWeb. Ironic, yes?',negative
.
.
.
然后我打开Weka Explorer加载该文件并应用StringToWordVector
过滤器将帖子拆分为单个单词属性。
然后,在对我的数据集执行相同操作后,选择(在 weka 的分类选项卡中)naive bayes
分类器并选择选择测试集,它返回Train and test set are not compatible
. 我能做些什么?谢谢!