简体   繁体   中英

IndexOutOfBoundsException in Mahout

I'm trying to run mahout SGD classifier on a CSV file, and I'm getting this error -


[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)

The CSV file contains unicode text, and large text fields enclosed by quote characters.

I've tried the classifier on the sample donut.csv, and it works fine. I also tried changing my header row to make it like "id","subject","field2",etc.., but it still doesn't work.

What am I doing wrong?

有些行可能很脏-仅具有4个属性而不是6个属性。请再次检查您的数据,或尝试仅提供一行数据以验证我的猜测。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM