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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 28 10:13:48 PDT 2016


Author: spawley
Date: 2016-03-28 10:13:48 -0700 (Mon, 28 Mar 2016)
New Revision: 68168

Modified:
   grass-addons/grass7/raster/r.randomforest/r.randomforest.html
Log:
Worked example in documentation for randomforest

Modified: grass-addons/grass7/raster/r.randomforest/r.randomforest.html
===================================================================
--- grass-addons/grass7/raster/r.randomforest/r.randomforest.html	2016-03-28 16:42:54 UTC (rev 68167)
+++ grass-addons/grass7/raster/r.randomforest/r.randomforest.html	2016-03-28 17:13:48 UTC (rev 68168)
@@ -26,8 +26,28 @@
 
 <h2>EXAMPLE</h2>
 
-r.randomforest igroup=lsat7_2000 at landsat roi=landcover_1m at PERMANENT output=rf_classification mode=classification ntrees=500 mfeatures=-1 minsplit=2 randst=1 lines=100
+Here we are going to use the GRASS GIS sample North Carolina data set as a basis to perform a landsat classification. We are going to classify a Landsat 7 scene from 2000, using training information from an older (1996) land cover dataset.
 
+<figure>
+<img src="lsat7_2000_b742.png" alt="Landsat 7 (2000) bands 7,4,2 color composite example">
+<figcaption>Landsat 7 (2000) bands 7,4,2 color composite example</figcaption>
+</figure>
+
+<br><br>First, we are going to generate some training pixels from an older (1996) land cover classification:
+<div class="code"><pre>
+r.random input=landclass96m at PERMANENT npoints=1000 raster=landclass96_roi at landsat
+</pre></div>
+
+<br><br>Then we can use these training pixels to perform a classification on the more recently obtained landsat 7 image:
+<div class="code"><pre>
+r.randomforest igroup=lsat7_2000 at landsat roi=landclass96_roi at landsat output=rf_classification mode=classification ntrees=500 mfeatures=-1 minsplit=2 randst=1 lines=100
+</pre></div>
+
+<figure>
+<img src="rfclassification.png" alt="Random forest classification result">
+<figcaption>Random forest classification result</figcaption>
+</figure>
+
 <h2>REFERENCES</h2>
 
 Breiman, L. (2001), Random Forests, Machine Learning 45(1), 5-32.



More information about the grass-commit mailing list