java weka 帮助:UnsupportedAttributeTypeException
所以我正在使用 Java 中的 Weka 机器学习库...
我试图实现这个: http://weka.wikispaces.com/Text+categorization+with+Weka
在底部,您可以下载 TextCategorizationTest.java(它执行文本分类)和 text_example.zip(其中包含一大堆) htmls....
所以我尝试使用text_example中的class1目录作为参数来运行TextCategorizationTest....但是后来我遇到了这个错误:
Exception in thread "main" weka.core.UnsupportedAttributeTypeException: weka.classifiers.trees.j48.C45PruneableClassifierTree: Cannot handle multi-valued nominal class!
at weka.core.Capabilities.test(Capabilities.java:936)
at weka.core.Capabilities.test(Capabilities.java:1105)
at weka.core.Capabilities.test(Capabilities.java:1018)
at weka.core.Capabilities.testWithFail(Capabilities.java:1297)
at weka.classifiers.trees.j48.C45PruneableClassifierTree.buildClassifier(C45PruneableClassifierTree.java:116)
at weka.classifiers.trees.J48.buildClassifier(J48.java:236)
at TextCategorizationTest.main(TextCategorizationTest.java:55)
它引用了这一行:
classifier.buildClassifier(dataFiltered);
有人出了什么问题吗?
So I'm working with the Weka Machine Learning Library in Java...
I was trying to implement this: http://weka.wikispaces.com/Text+categorization+with+Weka
at the bottom you can download TextCategorizationTest.java which does text categorization and the text_example.zip which contains a whole bunch of htmls....
so I tried running TextCategorizationTest using the class1 directory in the text_example as argument....but then I encountered this error:
Exception in thread "main" weka.core.UnsupportedAttributeTypeException: weka.classifiers.trees.j48.C45PruneableClassifierTree: Cannot handle multi-valued nominal class!
at weka.core.Capabilities.test(Capabilities.java:936)
at weka.core.Capabilities.test(Capabilities.java:1105)
at weka.core.Capabilities.test(Capabilities.java:1018)
at weka.core.Capabilities.testWithFail(Capabilities.java:1297)
at weka.classifiers.trees.j48.C45PruneableClassifierTree.buildClassifier(C45PruneableClassifierTree.java:116)
at weka.classifiers.trees.J48.buildClassifier(J48.java:236)
at TextCategorizationTest.main(TextCategorizationTest.java:55)
which refers to this line:
classifier.buildClassifier(dataFiltered);
does anybody what's wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
快速查看发现您使用的分类器不支持多值名义类。您可以尝试将您的课程更改为二进制吗?或者使用支持多值名义类的不同分类器(如 weka 中的 SMO 或 NN)?
A quick look reveals that the classifier that you are using does not supports multi-valued nominal class. Can you try by changing your class to binary ? Or use different classifier that supports multi-valued nominal class (like SMO or NN in weka)?