[GRASS-SVN] r67056 - grass-addons/grass7/vector/v.class.mlR

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 10 11:56:16 PST 2015


Author: mlennert
Date: 2015-12-10 11:56:16 -0800 (Thu, 10 Dec 2015)
New Revision: 67056

Modified:
   grass-addons/grass7/vector/v.class.mlR/v.class.mlR.py
Log:
all options are strings and need to be passed as such to the R strings


Modified: grass-addons/grass7/vector/v.class.mlR/v.class.mlR.py
===================================================================
--- grass-addons/grass7/vector/v.class.mlR/v.class.mlR.py	2015-12-10 17:55:34 UTC (rev 67055)
+++ grass-addons/grass7/vector/v.class.mlR/v.class.mlR.py	2015-12-10 19:56:16 UTC (rev 67056)
@@ -177,22 +177,22 @@
     model_string += "kernel = '%s', " % kernel
     tune = True
     if kernel == 'linear' and cost:
-        model_string += "cost = %f)" % cost
+        model_string += "cost = %s)" % cost
         tune = False
     if kernel == 'polynomial' and cost and degree and gamma and coeff0:
-        model_string += "cost = %f, " % cost
-        model_string += "degree = %d, " % degree
-        model_string += "gamma = %f, " % gamma
-        model_string += "coeff0 = %f)" % coeff0
+        model_string += "cost = %s, " % cost
+        model_string += "degree = %s, " % degree
+        model_string += "gamma = %s, " % gamma
+        model_string += "coeff0 = %s)" % coeff0
         tune = False
     if kernel == 'radial' and cost and gamma:
-        model_string += "cost = %f, " % cost
-        model_string += "gamma = %f)" % gamma
+        model_string += "cost = %s, " % cost
+        model_string += "gamma = %s)" % gamma
         tune = False
     if kernel == 'sigmoid' and cost and gamma and coeff0:
-        model_string += "cost = %f, " % cost
-        model_string += "gamma = %f, " % gamma
-        model_string += "coeff0 = %f)" % coeff0
+        model_string += "cost = %s, " % cost
+        model_string += "gamma = %s, " % gamma
+        model_string += "coeff0 = %s)" % coeff0
         tune = False
     if tune:
         model_string = "model=tune(svm, trainingclass~., data=training[-1], "



More information about the grass-commit mailing list