Description Usage Arguments Examples
This function automatically builds different predictive models with reasonable default settings based on the implementation in the caret package. Data preprocessing can happen automatically through applying aider's default recipe blueprint. It is currently only implemented for classification problems. The default resampling procedure is repeated cross-validation.
1 2 | train_model(df, target, type = "classification", models = c("rf"),
use_recipe = TRUE, folds = 5, repeats = 5, upsample = "yes")
|
df |
A data frame |
target |
A target variable |
type |
Specify the modelling task. Possible options are: "classification" (default) and "regression" |
models |
Specify type of models to train. Possibile options are: "rf" (Random Forest) as default, as well as "en" (Elastic-Net), "svm" (Support Vector Machines) and "xgb" (XgBoost) |
use_recipe |
Specify whether a standardized recipe should be applied. If FALSE then the dataset needs to pre-processed before applying the function. Defaults to TRUE |
folds |
Specify the number of folds in cross-validation. Defaults to 5 |
repeats |
Specify the number of times the fitting process should be repeated. Defaults to 5 |
upsample |
Should the minority class be upsampled during resampling? Defaults to "yes" |
1 2 3 4 | data <- recipes::credit_data %>%
first_to_lower()
models <- train_model(data, status, repeats = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.