[GRASS-SVN] r71179 - grass-addons/grass7/raster/r.learn.ml

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 12 21:36:15 PDT 2017


Author: spawley
Date: 2017-06-12 21:36:15 -0700 (Mon, 12 Jun 2017)
New Revision: 71179

Modified:
   grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py
Log:
removal of classifier calibration

Modified: grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py
===================================================================
--- grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py	2017-06-12 21:20:45 UTC (rev 71178)
+++ grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py	2017-06-13 04:36:15 UTC (rev 71179)
@@ -441,14 +441,13 @@
         from sklearn.cluster import KMeans
         from sklearn.preprocessing import StandardScaler, Imputer
         from sklearn.model_selection import (
-            GridSearchCV, RandomizedSearchCV, GroupShuffleSplit, ShuffleSplit,
+            GridSearchCV, GroupShuffleSplit, ShuffleSplit,
             StratifiedKFold, GroupKFold)
         from sklearn.preprocessing import OneHotEncoder
         from sklearn.pipeline import Pipeline
         from sklearn.utils import shuffle
         from sklearn import metrics
         from sklearn.metrics import make_scorer
-        from sklearn.calibration import CalibratedClassifierCV
     except:
         gscript.fatal("Scikit learn 0.18 or newer is not installed")
 
@@ -883,13 +882,6 @@
     if model_only is not True:
         gscript.message(os.linesep)
 
-        # recalibrate probabilities if classes have been balanced
-        if balance is True:
-            if any(param_grid) is True and nested_cv is True:
-                clf = clf.best_estimator_
-            clf = CalibratedClassifierCV(clf, cv=20)
-            clf.fit(X, y)
-
         # predict classification/regression raster
         if prob_only is False:
             gscript.message('Predicting classification/regression raster...')



More information about the grass-commit mailing list