View source: R/machine_learning.R
AStrain.as_data | R Documentation |
For each algorithm (column) in the data, a model is trained to later predict the output (KPI) for that algorithm (using function ASpredict()
).
## S3 method for class 'as_data'
AStrain(data_object, method = NULL, parallel = FALSE, f = NULL, ...)
data_object |
object of class |
method |
name of the model to be used. The user can choose from any of the models provided by |
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, |
... |
arguments passed to the caret train function. |
A list is returned of class as_train
containing the trained models, one for each of the algorithms.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.