Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Mahout中的IndexOutOfBoundsException_Java_Mahout - Fatal编程技术网

Java Mahout中的IndexOutOfBoundsException

Java Mahout中的IndexOutOfBoundsException,java,mahout,Java,Mahout,我试图在CSV文件上运行mahout SGD分类器,我得到了这个错误- [vineet@localhostbin]$./mahout trainlogistic--input./filtered.csv--output model--target target--categories 33\ --功能200--通过10--预测主题--类型文本--比率50 hadoop二进制文件不在本地运行的路径hadoop_HOME/bin、hadoop_PREFIX/bin中 线程“main”java.la

我试图在CSV文件上运行mahout SGD分类器,我得到了这个错误-


[vineet@localhostbin]$./mahout trainlogistic--input./filtered.csv--output model--target target--categories 33\
--功能200--通过10--预测主题--类型文本--比率50

hadoop二进制文件不在本地运行的路径hadoop_HOME/bin、hadoop_PREFIX/bin中 线程“main”java.lang.IndexOutOfBoundsException中的异常:索引:6,大小:4 位于java.util.ArrayList.rangeCheck(ArrayList.java:604) 获取(ArrayList.java:382) 位于org.apache.mahout.classifier.sgd.CsvRecordFactory.processLine(CsvRecordFactory.java:245) 位于org.apache.mahout.classifier.sgd.TrainLogistic.mainToOutput(TrainLogistic.java:85) 位于org.apache.mahout.classifier.sgd.TrainLogistic.main(TrainLogistic.java:65) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)中 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中 位于java.lang.reflect.Method.invoke(Method.java:601) 位于org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68) 位于org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139) 位于org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:195)

CSV文件包含unicode文本和由引号字符括起的大型文本字段

我在sample donut.csv上尝试了分类器,效果很好。 我还尝试更改标题行,使其类似于“id”、“subject”、“field2”等,但仍然不起作用


我做错了什么?

有些行可能脏了-只有4个属性而不是6个属性。再次检查您的数据,或者尝试只输入一行数据来验证我的猜测。

您正在获取索引:6,大小:4。是的,但我无法理解这一点,这有助于我解决问题-似乎mahout不喜欢我最后有一个空字段。。谢谢

[vineet@localhost bin]$ ./mahout trainlogistic --input ./filtered.csv --output model --target target --categories 33 \
--features 200 --passes 10 --predictors subject --types text --rate 50

hadoop binary is not in PATH,HADOOP_HOME/bin,HADOOP_PREFIX/bin, running locally Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 6, Size: 4 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.apache.mahout.classifier.sgd.CsvRecordFactory.processLine(CsvRecordFactory.java:245) at org.apache.mahout.classifier.sgd.TrainLogistic.mainToOutput(TrainLogistic.java:85) at org.apache.mahout.classifier.sgd.TrainLogistic.main(TrainLogistic.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68) at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139) at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:195)