WEKA 无法确定结构为 arff

发布于 2024-10-03 04:35:09 字数 748 浏览 0 评论 0原文

我正在编写一个脚本来使用 weka 进行一些分类,当我尝试运行分类器时出现错误。我已使用 weka.core.converters.CSVLoader 从 CSV 转换了文件。

然后,我使用 weka.filters.unsupervised.attribute.Remove -R 1,7,8 从中删除了一些属性

现在,当我尝试使用命令在其上运行分类器时,

java -classpath /home/jim/Downloads/weka-3-6-3/weka.jar weka.classifiers.trees.J48 -p 0 -split-percentage 66 -preserve-order -t arff_input/Config38-R.arff

我收到一条错误消息

java.io.IOException: Unable to determine structure as arff (Reason: java.io.IOException: premature end of file, read Token[EOF], line 1).

“编辑” - 我想这个我的第一行有一个错误,所以就在这里。

@relation 'Config38-weka.filters.unsupervised.attribute.Remove-R1,7,8'

还有其他人遇到过类似的问题吗?或者我在某个地方犯了错误。

谢谢

I am writing a script to do some classification using weka and I get an error when I try to run the classifier. I have converted the file from CSV using weka.core.converters.CSVLoader.

I have then removed some of the attributes from it using weka.filters.unsupervised.attribute.Remove -R 1,7,8

Now when I try to run the classifier on it using the command

java -classpath /home/jim/Downloads/weka-3-6-3/weka.jar weka.classifiers.trees.J48 -p 0 -split-percentage 66 -preserve-order -t arff_input/Config38-R.arff

I get an error saying

java.io.IOException: Unable to determine structure as arff (Reason: java.io.IOException: premature end of file, read Token[EOF], line 1).

EDIT - I presume this is an error in my first line so here it is.

@relation 'Config38-weka.filters.unsupervised.attribute.Remove-R1,7,8'

Has anyone else encountered a similar problem? Or have I made a mistake some where.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

窗影残 2024-10-10 04:35:09

我将第一行更改为

@relation Config38

,现在它可以工作了。不知道为什么这个有效,而上面的却不起作用,我害怕

I changed the first line to

@relation Config38

and now it works. No idea why this works and the above didn't I'm afriad

小女人ら 2024-10-10 04:35:09

如果删除 .arff 文件中的第一行,它也将起作用。

If you delete the first line in .arff file it will also work.

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