Implementation to control the computational nuances of train function for bi-class problems.
D2MCS::TrainFunction -> TwoClass
new()TwoClass$new(
method,
number,
savePredictions,
classProbs,
allowParallel,
verboseIter,
seed = NULL
)methodThe resampling method: "boot", "boot632", "optimism_boot", "boot_all", "cv", "repeatedcv", "LOOCV", "LGOCV" (for repeated training/test splits), "none" (only fits one model to the entire training set), "oob" (only for random forest, bagged trees, bagged earth, bagged flexible discriminant analysis, or conditional tree forest models), timeslice, "adaptive_cv", "adaptive_boot" or "adaptive_LGOCV"
numberEither the number of folds or number of resampling iterations
savePredictionsAn indicator of how much of the hold-out predictions for each resample should be saved. Values can be either "all", "final", or "none". A logical value can also be used that convert to "all" (for true) or "none" (for false). "final" saves the predictions for the optimal tuning parameters.
classProbsA logical value. Should class probabilities be computed for classification models (along with predicted values) in each resample?
allowParallelA logical value. If a parallel backend is loaded and available, should the function use it?
verboseIterA logical for printing a training log.
seedAn optional integer that will be used to set the seed during model training stage.
create()Creates a trainControl requires for the
training stage.
TwoClass$create(summaryFunction, search.method = "grid", class.probs = NULL)summaryFunctionAn object inherited from
SummaryFunction class.
search.methodEither "grid" or "random", describing how the tuning parameter grid is determined.
class.probsA logical indicating if class probabilities should be computed for classification models (along with predicted values) in each resample
getTrFunction()Function used to return the
trainControl object.
TwoClass$getTrFunction()A trainControl object.
setClassProbs()The function allows changing the class computation capabilities.
TwoClass$setClassProbs(class.probs)
getMeasures()Returns the measures used to optimize model hyperparameters.
TwoClass$getMeasures()A character vector.
getType()Obtains the type of classification problem ("Bi-class" or "Multi-class").
TwoClass$getType()A character vector with "Bi-class" value.
setSummaryFunction()Function used to change the SummaryFunction
used in the training stage.
TwoClass$setSummaryFunction(summaryFunction)summaryFunctionAn object inherited from
SummaryFunction class.
clone()The objects of this class are cloneable with this method.
TwoClass$clone(deep = FALSE)deepWhether to make a deep clone.
TrainFunction