Description Usage Arguments Details Author(s) Examples
This function performs the training of the chosen classifier
1 2 3 4 |
df.train |
Training dataframe |
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 |
classifier |
Choice of classifier to be used to train model. Uses algortims names from Caret package. |
nfolds |
Number of folds to be build in crossvalidation |
repeats |
repeats |
index |
index |
cpu_cores |
Number of CPU cores to be used in parallel processing |
tune_length |
This argument is the number of levels for each tuning parameters that should be generated by train |
search |
search option "grid" or "random" |
metric |
metric used to evaluate model fit. For numeric outcome ("RMSE", "Rsquared) |
seeds |
seeds seeds |
verbose |
verbose |
details
Elpidio Filho, elpidio@ufv.br
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
library(dplyr)
library(labgeo)
data("iris")
d = iris %>% select(Species, everything())
vt = train_test(df = d, p = 0.75,seed = 313)
train = vt$train
test = vt$test
fit = classification(df.train = train, preprocess = c('center', 'scale'),
classifier = 'rf', nfolds = 5, cpu_cores = 0,
metric = 'Kappa', tune_length = 3,
verbose = T )
pred = predict(fit, test)
obs = test[,1]
plot_confusion_matrix(obs, pred)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.