X-Git-Url: https://git.auder.net/images/pieces/%22%20%20%20VariantRules.getPpath%28board%5Bi%5D%5Bj%5D%29%20%20%20%22.svg?a=blobdiff_plain;f=R%2FR6_AgghooCV.R;h=ed9aa5c75394b0430698497bfcb812fc493cf3e9;hb=43a6578d444f388d72755e74c7eed74f3af638ec;hp=c555641f4263cf8f57fd1187d907b3b6c97e818a;hpb=7b5193cdf5eb7041710c52368764feeacbb36a7c;p=agghoo.git diff --git a/R/R6_AgghooCV.R b/R/R6_AgghooCV.R index c555641..ed9aa5c 100644 --- a/R/R6_AgghooCV.R +++ b/R/R6_AgghooCV.R @@ -25,11 +25,11 @@ AgghooCV <- R6::R6Class("AgghooCV", private$loss <- loss }, #' @description Fit an agghoo model. - #' @param CV List describing cross-validation to run. Slots: - #' - type: 'vfold' or 'MC' for Monte-Carlo (default: MC) - #' - V: number of runs (default: 10) + #' @param CV List describing cross-validation to run. Slots: \cr + #' - type: 'vfold' or 'MC' for Monte-Carlo (default: MC) \cr + #' - V: number of runs (default: 10) \cr #' - test_size: percentage of data in the test dataset, for MC - #' (irrelevant for V-fold). Default: 0.2. + #' (irrelevant for V-fold). Default: 0.2. \cr #' - shuffle: wether or not to shuffle data before V-fold. #' Irrelevant for Monte-Carlo; default: TRUE fit = function( @@ -89,7 +89,7 @@ AgghooCV <- R6::R6Class("AgghooCV", return (invisible(NULL)) } V <- length(private$pmodels) - oneLineX <- as.data.frame(t(as.matrix(X[1,]))) + oneLineX <- t(as.matrix(X[1,])) if (length(private$pmodels[[1]]$model(oneLineX)) >= 2) # Soft classification: return (Reduce("+", lapply(private$pmodels, function(m) m$model(X))) / V)