AStrain.as_data: Training models for posterior selection of algorithms

View source: R/machine_learning.R

AStrain.as_dataR Documentation

Training models for posterior selection of algorithms

Description

For each algorithm (column) in the data, a model is trained to later predict the output (KPI) for that algorithm (using function ASpredict()).

Usage

## S3 method for class 'as_data'
AStrain(data_object, method = NULL, parallel = FALSE, f = NULL, ...)

Arguments

data_object

object of class as_data.

method

name of the model to be used. The user can choose from any of the models provided by caret. See http://topepo.github.io/caret/train-models-by-tag.html for more information about the models supported.

parallel

boolean to control whether to parallelise the training or not (paralellization is handled by library snow).

f

function we want to use to train the models. If NULL, caret's function will be used.

...

arguments passed to the caret train function.

Value

A list is returned of class as_train containing the trained models, one for each of the algorithms.

Examples

data(branchingsmall)
data_object <- partition_and_normalize(branchingsmall$x, branchingsmall$y, test_size = 0.3,
family_column = 1, split_by_family = TRUE)
training <- AStrain(data_object, method = "glm")
custom_function <- function(x, y) {
  glm.fit(x, y)
}
custom_training <- AStrain(data_object, f = "custom_function")

ASML documentation built on April 3, 2025, 8:47 p.m.

Related to AStrain.as_data in ASML...