classification: classification

Description Usage Arguments Details Author(s) Examples

Description

This function performs the training of the chosen classifier

Usage

1
2
3
4
classification(df.train, formula = NULL, preprocess = NULL,
  classifier = "rf", rsample = "cv", nfolds = 10, repeats = NA,
  index = NULL, cpu_cores = 4, tune_length = 5, search = "grid",
  metric = "Kappa", seeds = NULL, verbose = FALSE)

Arguments

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

details

Author(s)

Elpidio Filho, elpidio@ufv.br

Examples

 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)

elpidiofilho/labgeo documentation built on May 14, 2019, 9:35 a.m.