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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 20 06:39:31 PST 2019


Author: AnikaBettge
Date: 2019-02-20 06:39:31 -0800 (Wed, 20 Feb 2019)
New Revision: 74113

Modified:
   grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py
Log:
r.learn.ml python3 compatible: basestring

Modified: grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py
===================================================================
--- grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py	2019-02-20 12:18:35 UTC (rev 74112)
+++ grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py	2019-02-20 14:39:31 UTC (rev 74113)
@@ -414,6 +414,12 @@
 from grass.pygrass.raster import RasterRow
 
 
+try:
+    basestring
+except NameError:
+    basestring = str
+
+
 def model_classifiers(estimator, random_state, n_jobs, p, weights=None):
     """
     Provides the classifiers and parameters using by the module
@@ -1127,7 +1133,7 @@
     from sklearn.pipeline import Pipeline
 
     rs_estimator = deepcopy(estimator)
-    
+
     # create training and test folds
     X_train, y_train = X[train_indices], y[train_indices]
 
@@ -1479,7 +1485,7 @@
             categorymaps = [categorymaps]
         else:
             categorymaps = categorymaps.split(',')
-        
+
         cat_indexes = []
 
         # check that each category map is also in the imagery group



More information about the grass-commit mailing list