java weka 帮助:UnsupportedAttributeTypeException

发布于 2024-11-17 12:49:36 字数 1160 浏览 3 评论 0原文

所以我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

作妖 2024-11-24 12:49:36

快速查看发现您使用的分类器不支持多值名义类。您可以尝试将您的课程更改为二进制吗?或者使用支持多值名义类的不同分类器(如 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)?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文