[GRASS-SVN] r68634 - grass-addons/grass7/raster/r.randomforest
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 8 01:30:44 PDT 2016
Author: neteler
Date: 2016-06-08 01:30:44 -0700 (Wed, 08 Jun 2016)
New Revision: 68634
Modified:
grass-addons/grass7/raster/r.randomforest/r.randomforest.html
grass-addons/grass7/raster/r.randomforest/r.randomforest.py
Log:
r.randomforest addon: fix error message if python-scikit-learn not installed; mention package name in manual
Modified: grass-addons/grass7/raster/r.randomforest/r.randomforest.html
===================================================================
--- grass-addons/grass7/raster/r.randomforest/r.randomforest.html 2016-06-08 02:47:53 UTC (rev 68633)
+++ grass-addons/grass7/raster/r.randomforest/r.randomforest.html 2016-06-08 08:30:44 UTC (rev 68634)
@@ -18,8 +18,13 @@
<h2>NOTES</h2>
-<em><b>r.randomforest</b></em> uses the scikit-learn machine learning python package. This python package needs to be installed within your GRASS python environment for <em><b>r.randomforest</b></em> to work. For linux users, this package should be available through the linux package manager in most distributions. For windows users, the easiest way of installing the packages is by using the precompiled binaries from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">Christoph Gohlke</a> and by using the <a href="https://grass.osgeo.org/download/software/ms-windows/">Osgeo4W</a> installation method of GRASS, where the python setuptools can also be installed. You can then use 'easy_install pip' to install the pip package manager. Then, you can download the NumPy-1.10+MKL and scikit-learn .whl files and install them using 'pip install packagename.whl'.
+<em><b>r.randomforest</b></em> uses the "scikit-learn" machine learning python package. This python package needs to be installed within your GRASS GIS Python environment for <em><b>r.randomforest</b></em> to work.
+<br>
+For Linux users, this package should be available through the linux package manager in most distributions (named for example "python-scikit-learn").
+<br>
+For MS-Windows users, the easiest way of installing the packages is by using the precompiled binaries from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">Christoph Gohlke</a> and by using the <a href="https://grass.osgeo.org/download/software/ms-windows/">OSGeo4W</a> installation method of GRASS, where the python setuptools can also be installed. You can then use 'easy_install pip' to install the pip package manager. Then, you can download the NumPy-1.10+MKL and scikit-learn .whl files and install them using 'pip install packagename.whl'.
+<p>
<em><b>r.randomforest</b></em> is designed to keep system memory requirements relatively low. For this purpose, the rasters are read from the disk row-by-row, using the RasterRow method in PyGRASS. This however does not represent an efficient volume of data to pass to the classifier, which is multithreaded by default. Therefore, groups of rows specified by the <i>lines</i> parameter are passed to the classifier, and the reclassified image is reconstructed and written row-by-row back to the disk. <i>Lines=50</i> should be reasonable for most systems with 4-8 GB of ram. However, if you have a workstation with much larger resources, then <i>lines</i> could be set to a much larger size (including to a value that is equal or greater than the number of rows in the current region setting) in which case the entire image will be loaded into memory to classification.
<br><br> The bootstrapping process involved within random forests also causes a small amount of variation in the classification results, out-of-bag error, and feature importances. To enable reproducible results, a seed is supplied to the classifier. This can be changed using the <i>randst</i> parameter.
Modified: grass-addons/grass7/raster/r.randomforest/r.randomforest.py
===================================================================
--- grass-addons/grass7/raster/r.randomforest/r.randomforest.py 2016-06-08 02:47:53 UTC (rev 68633)
+++ grass-addons/grass7/raster/r.randomforest/r.randomforest.py 2016-06-08 08:30:44 UTC (rev 68634)
@@ -155,7 +155,7 @@
imp.find_module(module_name)
return True
except ImportError:
- grass.fatal("{} Python package not installed. Exiting").format(module_name)
+ grass.fatal("Python package <%s> not installed. Exiting" % module_name)
return False
# lazy imports
More information about the grass-commit
mailing list