<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
    <div dir="ltr">
      <div>Hi Steve<br>
        <br>
      </div>
      Great news! I gave it a quick try (on Ubuntu 14.04, GRASS 7
      master). Size input raster layers: rows: 1578, columns: 1436 <br>
      <br>
      <b>1st try - input full map, classes 1/0, </b><br>
      I had to stop as it took too much time. Stopping it did not stop
      the python processes however, I had to kill the processes.<br>
      <br>
      <b>2nd try - input random sample of 100 points, 1 (12) and 0 (88),
        with b flag</b><br>
      r.randomforest -b igroup=predictors@SampleSize roi=test2
      output=test2_output ntrees=500 mfeatures=-1 minsplit=2 randst=1
      lines=100<br>
      Group <predictors> references the following raster maps:<br>
      Traceback (most recent call last):<br>
        File "/home/paulo/.grass7/addons/scripts/r.randomforest",<br>
      line 335, in <module><br>
          main()<br>
        File "/home/paulo/.grass7/addons/scripts/r.randomforest",<br>
      line 243, in main<br>
          class_weight = "balanced", max_features = mfeatures,<br>
      min_samples_split = minsplit, random_state = randst)<br>
      TypeError: __init__() got an unexpected keyword argument<br>
      'class_weight'<br>
      Removing raster <tmp_jNyNcqZa><br>
      <br>
      <b>3rd try</b><b> - input random sample of 100 points, 1 (#12) and
        0 (#88), with b flag</b><br>
      r.randomforest igroup=predictors@SampleSize roi=test2
      output=test2_output ntrees=500 mfeatures=-1 minsplit=2 randst=1
      lines=100<br>
      Group <predictors> references the following raster maps:<br>
      Our OOB prediction of accuracy is: 89.0%<br>
                         Raster  Importance<br>
      0   bio1_wc30s@SampleSize    0.183670<br>
      1   bio2_wc30s@SampleSize    0.139914<br>
      2   bio3_wc30s@SampleSize    0.105035<br>
      3   bio4_wc30s@SampleSize    0.106413<br>
      4  bio13_wc30s@SampleSize    0.087399<br>
      5  bio14_wc30s@SampleSize    0.146495<br>
      6     dm_wc30s@SampleSize    0.104575<br>
      7   llds_wc30s@SampleSize    0.126499<br>
      Removing raster <tmp_RhTllKlA><br>
      <br>
      <b>Questions</b><br>
      * I am using it for species distribution modeling
      (presence/absence input map), but I prefer to use the regression
      mode. Is there a way to force it to use the regression mode?<br>
      * Are you planning to implement other classification methods?
      Seems if this works it shouldn't be too hard to replace the
      randomforest method by any of the other methods in scipy? I have
      for som time been thinking about using scipy, but my programming
      skills are not up to standards. But perhaps it is easier using
      your addon as template?<br>
      <br>
      Cheers,<br>
      <br>
      Paulo<br>
      <br>
      <br>
      <div><br>
        <div>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">On Sat, Mar 26, 2016 at 5:40 PM,
              Steven Pawley <span dir="ltr"><<a
                  href="mailto:dr.stevenpawley@gmail.com"
                  target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:dr.stevenpawley@gmail.com">dr.stevenpawley@gmail.com</a></a>></span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div>Hello developers,</div>
                <div><br>
                </div>
                <div>I would like to draw your attention to a new GRASS
                  add-on, r.randomforest, which uses the scikit-learn
                  and pandas Python packages to classify GRASS rasters.
                  Similar to existing GRASS classification methods, it
                  uses an imagery group and a raster of labelled pixels
                  as the inputs for the classification. It also reads
                  the rasters row-by-row, and then bundles these rows
                  based on a user specified row increment to the
                  classifier to keep memory requirements low, but also
                  allow efficient classification because the
                  scikit-learn implementation is multithreaded by
                  default, and row-by-row results in too much stop-start
                  behaviour. The feature importance scores and
                  out-of-bag error are displayed in the command window.</div>
                <div><br>
                </div>
                <div>I would appreciate testing - you need to have
                  scikit-learn and pandas installed in your Python
                  environment which is easy on Linux and OS X, and
                  instructions are provided in the tool for Windows.</div>
                <div><br>
                </div>
                <div>I have another add-on that I will upload soon,
                  r.roc, which generates ROC and AUROC for prediction
                  models.</div>
                <div><br>
                </div>
                <div>Steve</div>
                <div><br>
                  <div>Sent from <a href="https://aka.ms/sdimjr"
                      target="_blank">Outlook Mobile</a></div>
                  <br>
                </div>
                <br>
                _______________________________________________<br>
                grass-dev mailing list<br>
                <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
                <a
                  href="http://lists.osgeo.org/mailman/listinfo/grass-dev"
                  rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-dev">http://lists.osgeo.org/mailman/listinfo/grass-dev</a></a><br>
              </blockquote>
            </div>
            <br>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>