[GRASS-SVN] r68684 - grass-addons/grass7/raster/r.randomforest

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 14 12:18:26 PDT 2016


Author: neteler
Date: 2016-06-14 12:18:26 -0700 (Tue, 14 Jun 2016)
New Revision: 68684

Modified:
   grass-addons/grass7/raster/r.randomforest/r.randomforest.html
   grass-addons/grass7/raster/r.randomforest/r.randomforest.py
Log:
r.randomforest addon: mention name of Python package

Modified: grass-addons/grass7/raster/r.randomforest/r.randomforest.html
===================================================================
--- grass-addons/grass7/raster/r.randomforest/r.randomforest.html	2016-06-14 19:12:29 UTC (rev 68683)
+++ grass-addons/grass7/raster/r.randomforest/r.randomforest.html	2016-06-14 19:18:26 UTC (rev 68684)
@@ -1,6 +1,6 @@
 <h2>DESCRIPTION</h2>
 
-<em><b>r.randomforest</b></em> performs Random forests classification and regression on a suite of predictors within a GRASS imagery group. Random forest (Breiman, 2001) is an ensemble classification tree method which constructs a forest of uncorrelated decision trees based on a random subset of predictor variables, which occurs independently at every node split in each tree. Each tree produces a prediction probability, and the final classification result is obtained by averaging of the prediction probabilities across all of the trees. The probability of membership to the individual classes (<i>class_probabilities</i> flag) can also be output using the -p flag. The scikit-learn randomforest implementation differs from the original Breiman (2001) reference which uses majority voting rather than averaging.
+<em><b>r.randomforest</b></em> performs Random forests classification and regression on a suite of predictors within a GRASS imagery group. Random forest (Breiman, 2001) is an ensemble classification tree method which constructs a forest of uncorrelated decision trees based on a random subset of predictor variables, which occurs independently at every node split in each tree. Each tree produces a prediction probability, and the final classification result is obtained by averaging of the prediction probabilities across all of the trees. The probability of membership to the individual classes (<i>class_probabilities</i> flag) can also be output using the -p flag. The scikit-learn (python-sklearn) randomforest implementation differs from the original Breiman (2001) reference which uses majority voting rather than averaging.
 
 <br><br>Random forests offers a number of advantages over traditional statistical classifiers because it is non-parametric and can deal with non-linear relationships and  categorical data, and no rescaling is required. Random forests also require relatively few user-specified parameter choices, principally consisting of the number of trees in the forest (<i>ntrees</i>), and the number of variables that are allowed to be chosen from at each node split (<i>mfeatures</i>), which controls the degree of correlation between the trees. There is no accuracy penalty in having a large number of trees apart from increased computational time. For randomforest classification, the default <i>ntrees</i> is 500 and the default setting of <i>mfeatures</i> is equal to the square root of the number of predictors.
 

Modified: grass-addons/grass7/raster/r.randomforest/r.randomforest.py
===================================================================
--- grass-addons/grass7/raster/r.randomforest/r.randomforest.py	2016-06-14 19:12:29 UTC (rev 68683)
+++ grass-addons/grass7/raster/r.randomforest/r.randomforest.py	2016-06-14 19:18:26 UTC (rev 68684)
@@ -155,7 +155,7 @@
         imp.find_module(module_name)
         return True
     except ImportError:
-        grass.fatal("Python package <%s> not installed. Exiting" % module_name)
+        grass.fatal("Python package <%s> not installed (python-sklearn). Exiting" % module_name)
         return False
         
 # lazy imports
@@ -166,7 +166,7 @@
     import warnings
     warnings.filterwarnings("ignore")
 else:
-    grass.fatal("Scikit-learn python module is not installed.....exiting")
+    grass.fatal("Scikit-learn python module (python-sklearn) is not installed.....exiting")
 
 def cleanup():
     # We can then close the rasters and the roi image



More information about the grass-commit mailing list