Description Usage Arguments Details Author(s) Examples
This function run many models using the same data
1 2 3 4 5 6 | run_models(df, models = ifelse(is.factor(df[, 1]), c("qda", "rf", "gbm",
"C5.0"), c("lm", "cubist", "gbm", "rf")), formula = NULL,
preprocess = NULL, index = NULL, resample_ = "cv", nfolds = 10,
repeats = NA, tune_length = 5, cpu_cores = 0,
metric = ifelse(is.factor(df[, 1]), "Kappa", "Rsquared"), seeds = NULL,
verbose = TRUE)
|
df |
Training dataframe |
models |
chosen models to be used to train model. Uses algortims names from Caret package. |
formula |
A formula of the form y ~ x1 + x2 + ... If users don't inform formula, the first column will be used as Y values and the others columns with x1,x2....xn |
preprocess |
pre process |
index |
Users cross validation folds. Default = NULL |
resample_ |
resample method 'boot', 'boot632', 'optimism_boot', 'boot_all', 'cv', 'repeatedcv', 'LOOCV', 'LGOCV','none', 'oob', 'timeslice', 'adaptive_cv', 'adaptive_boot', 'adaptive_LGOCV' |
nfolds |
Number of folds to be build in crossvalidation |
repeats |
number of repeats to resample method repeatedcv |
tune_length |
This argument is the number of levels for each tuning parameters that should be generated by train |
cpu_cores |
Number of CPU cores to be used in parallel processing |
metric |
metric used to evaluate model fit. For numeric outcome ("RMSE", "Rsquared) |
seeds |
generate random seeds to allow reproductible results |
verbose |
prints results during the execution of the function |
details
Elpidio Filho, elpidio@ufv.br
1 2 3 4 5 | ## Not run:
models = c("ridge", "rf", "cubist",'pls','pcr','foba','gbm','glmboost')
fit_models = run_models(df,models = models)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.