classify: Fit GBDT model and predict classification

Description Usage Arguments Examples

View source: R/classify.R

Description

Fit GBDT model and predict classification

Usage

1
classify(data, train, verbose = TRUE, ...)

Arguments

data

a data.frame with signal characteristics of signals to be predicted

train

a data.frame with signal characteristics and classification of signals from which to learn the model

verbose

when TRUE (the default), print information about the fitted model

...

passed to fit.gbdt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(sirena)
sub <- subsample(sirena[,-ncol(sirena)], p=0.2)
train <- sirena[sub$picked,]
data <- sirena[!sub$picked,]
pred <- classify(data=data[,-ncol(data)], train=train,
                 n.trees=100, shrinkage=0.01, n.minobsinnode=1,
                 n.cores=1)
# NB: n.cores = 1 is necessary for examples to run on all machines. Feel
#     free to remove it and use more cores on your machine.
head(pred)
(cm <- confusion_matrix(true=data$type, pred=pred$type))
confusion_stats(cm)

jiho/soundclass documentation built on May 17, 2017, 9:20 p.m.