Exception in thread "main" java.lang.IllegalArgumentException in Mahout

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Exception in thread "main" java.lang.IllegalArgumentException in Mahout

Ananya Chandraker
This post has NOT been accepted by the mailing list yet.
Hi Everyone,

I am trying to run Random forest with the help of apache mahout,

I have done all setting and successfully executed the example for random-forest with example data set as given in https://mahout.apache.org/users/classification/partial-implementation.html

>when I am running the random forest for my own data I am facing certain issues please help

>while generating descriptor file I am getting below error:

-B9900:~/xyz/hadoop jar mahout-core-0.9-job.jar org.apache.mahout.classifier.df.tools.Describe -p /xxxx/xyz.csv -f /xxx/xyzClass.info -d 6 L N
Warning: $HADOOP_HOME is deprecated.

15/06/29 21:30:08 INFO tools.Describe: Generating the descriptor...
15/06/29 21:30:08 INFO tools.Describe: generating the dataset...
Exception in thread "main" java.lang.IllegalArgumentException: Wrong number of attributes in the string: 9. Must be: 7
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125)
        at org.apache.mahout.classifier.df.data.DataLoader.parseString(DataLoader.java:67)
        at org.apache.mahout.classifier.df.data.DataLoader.generateDataset(DataLoader.java:187)
        at org.apache.mahout.classifier.df.tools.Describe.generateDataset(Describe.java:127)
        at org.apache.mahout.classifier.df.tools.Describe.runTool(Describe.java:115)
        at org.apache.mahout.classifier.df.tools.Describe.main(Describe.java:100)
        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:606)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

>my dataset looks like below:

"61-90",">6","Bud_rail","2-2.5","G8","3",0
"61-90",">6","Bud_rail","2-2.5","G8","3",0
"61-90",">6","Bud_rail","2-2.5","G8","3",0
"31-40","3","Bud_rail","2-2.5","G8","1",0

>it contains 7 Col

>please give any suggestion how to give information for the attribute on the data