Fix regression
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 11 Jun 2021 17:02:44 +0000 (19:02 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 11 Jun 2021 17:02:44 +0000 (19:02 +0200)
R/R6_AgghooCV.R
test/compareToCV.R

index 9cdf19e..2734d69 100644 (file)
@@ -98,7 +98,7 @@ AgghooCV <- R6::R6Class("AgghooCV",
         all_predictions[,v] <- private$pmodels[[v]]$model(X)
       if (private$task == "regression")
         # Easy case: just average each row
-        rowSums(all_predictions)
+        return (rowMeans(all_predictions))
       # "Hard" classification:
       apply(all_predictions, 1, function(row) {
         t <- table(row)
index d3b9011..a124dd2 100644 (file)
@@ -37,6 +37,8 @@ standardCV <- function(data, target, task = NULL, gmodel = NULL, params = NULL,
           }
         }
       }
+      else
+        mean(abs(y1 - y2))
     }
   }