Unable to add class: org.apache.mahout.classifier.df.mapreduce.BuildForest in Mahout.0.13

1)When I run this Random Forest example

$MAHOUT_HOME/bin/mahout org.apache.mahout.classifier.df.mapreduce.BuildForest -Dmapred.max.split.size=1874231 -d inputMahoutExamples/RandomForest/rfsplit/trainingSet/* -ds inputMahoutExamples/RandomForest/glass.info -sl 5 -p -t 10 -o inputMahoutExamples/RandomForest/rfmodel

I got this error

MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath.
Running on hadoop, using /usr/local/hadoop-2.7.2/bin/hadoop and HADOOP_CONF_DIR=/usr/local/hadoop-2.7.2/etc/hadoop
MAHOUT-JOB: /usr/local/mahout/examples/target/mahout-examples-0.13.0-job.jar
17/08/02 16:55:29 WARN MahoutDriver: Unable to add class: org.apache.mahout.classifier.df.mapreduce.BuildForest
java.lang.ClassNotFoundException: org.apache.mahout.classifier.df.mapreduce.BuildForest
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.apache.mahout.driver.MahoutDriver.addClass(MahoutDriver.java:237)
    at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:128)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:6

2)I am working with Mahout-0.13 and hadoop -2.7.2

 $HADOOP_HOME/bin/hadoop jar $MAHOUT_HOME/examples/target/mahout-examples-0.13.0-job.jar org.apache.mahout.classifier.df.mapreduce.BuildForest -d inputMahoutExamples/RandomForest/rfsplit/trainingSet/* -ds inputMahoutExamples/RandomForest/glass.info -sl 5 -p -t 100 -o inputMahoutExamples/RandomForest/rfmodel

Also I got same error

Exception in thread "main" java.lang.ClassNotFoundException: org.apache.mahout.classifier.df.mapreduce.BuildForest
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

I think this problem just with Mahout-0.13. What do you think?

hadoop, BuildForest -Dmapred.max.split.size=1874231 -d $MAHOUT_HOME/bin/​mahout org.apache.mahout.classifier.df.mapreduce.BuildForest 17/08/02 16:​55:29 WARN MahoutDriver: Unable to add class: org.apache.mahout.classifier.df​.mapreduce. addClass(MahoutDriver.java:237) at org.apache.mahout.driver. 0 Unable to add class: org.apache.mahout.classifier.df.mapreduce.BuildForest in Mahout.0.13 Sep 28 '17 -2 Determine if all the values in a PHP array are null Apr 25 '19 -2 Convert stdClass object to associative array in php Nov 23 '19

I was facing exactly the same issue. I think they did not include random forest classifier in their last release (not sure though). It doesn't show in the documentation. Even their documentation website is still in beta mode. They mentioned two new classifiers:

org.apache.mahout.classifier.df.mapreduce.inmem     

In-memory mapreduce implementation of Random Decision Forests

org.apache.mahout.classifier.df.mapreduce.partial   

Partial-data mapreduce implementation of Random Decision Forests

In order to run the command, I had to download and load version 0.11.0 of Mahout. However, I am now confused. Why should I use it and trust the output whereas it was abandoned by its developers? In previous releases, they mentioned some bugs that are not related to the algorithms but more to managing performance:

For now, the training does not support multiple input files. The input dataset must be one single file (this support will be available with the upcoming release). Classifying new data does support multiple input files. The tree building is done when each mapper.close() method is called. Because the mappers don’t refresh their state, the job can fail when the dataset is big and you try to build a large number of trees.

It worked though.

Impossible d'ajouter la classe: org.apache.mahout.classifier.df , Error: Could not find or load main class org.apache.mahout.driver · When I run k-​Means Mahout 0.13.0 spark-shell examples fails with "no jniViennaCL in java.​library.path" Unable to add class: org.apache.mahout.classifier.df.mapreduce. Apache Mahout 0.12: Unknown program 'buildforest' chosen (Random Forest). [ Natty] hadoop Unable to add class: org.apache.mahout.classifier.df.mapreduce.BuildForest in Mahout.0.13 By: Khoubeib Bouthour 2.0; [ Natty ] python How to get all matching elements without scrolling using robot framework and python?

I also faced this problem .I think the problem is happened in latest version because ,Random forest is not included in classification with CLI drivers in Here .I have solved this problem by running on earlier version of mahout i.e. mahout 0.9 .

Невозможно добавить класс: org.apache.mahout.classifier.df , He has organized many boot camps for the Apache Mahout and Hadoop We also provide you with a PDF file that has color images of the screenshots/ The word classification always reminds us of our biology class, where we learned fruits based on different features present in the dataset, but it will not be able to label. If you look at the org.apache.mahout.classifier.df.mapreduce.BuildForest class below, it sets up the MapReduce job with the following available options. –data –dataset –selection –no-complete –minsplit –minprop –seed –partial –nbtrees –output. org.apache.mahout.classifier.df.mapreduce.BuildForest

Questions for tag mahout, Spark requires a set of jars on the classpath for the client side part of an app and another set of jars must be passed to the Spark Context for running distributed code. The example should discover all the neccessary classes automatically. ##Application Using Mahout as a library in an application will require a little Scala code.

[PDF] Learning Apache Mahout Classification, If you look at the org.apache.mahout.classifier.df.mapreduce.BuildForest class below, it sets up the MapReduce job with the following available options. –data –dataset –selection –no-complete –minsplit –minprop –seed –partial –nbtrees –output. org.apache.mahout.classifier.df.mapreduce.BuildForest

Teams. Q&A for Work. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

Comments
  • Where did this command come from that you are trying to run? It seems as either the classpath is incomplete, or you are missing required libraries.
  • from on website I forgot its URL and also I tried this command
  • $HADOOP_HOME/bin/hadoop jar $MAHOUT_HOME/examples/target/mahout-examples-0.13.0-job.jar org.apache.mahout.classifier.df.mapreduce.BuildForest -d inputMahoutExamples/RandomForest/rfsplit/trainingSet/* -ds inputMahoutExamples/RandomForest/glass.info -sl 5 -p -t 100 -o inputMahoutExamples/RandomForest/rfmodel
  • issues.apache.org/jira/browse/MAHOUT-932