binest: Binary Classification

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mt_accest.R

Description

Binary classification.

Usage

1
  binest(dat, cl, choices = NULL, method, pars=valipars(),...) 

Arguments

dat

A matrix or data frame containing the explanatory variables.

cl

A factor specifying the class for each observation.

choices

The vector or list of class labels to be chosen for binary classification. For details, see dat.sel.

method

Classification method to be used. For details, see accest.

pars

A list of parameters of the resampling method. For details, see valipars.

...

Additional parameters to method.

Value

A list with components:

com

A matrix of combination of the binary class labels.

acc

A table of classification accuracy for the binary combination in each iteration.

method

Classification method used.

sampling

Sampling scheme used.

niter

Number of iterations.

nreps

Number of replications in each iteration if resampling is not loocv.

Author(s)

Wanchang Lin

See Also

accest, valipars, dat.sel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# iris data set
data(iris)
dat <- subset(iris, select = -Species)
cl  <- iris$Species

## PCALDA with cross-validation
pars    <- valipars(sampling="cv",niter = 6, nreps = 5)
binpcalda <- binest(dat,cl,choices=c("setosa"), method="pcalda", pars = pars)

## SVM with leave-one-out cross-validation. SVM kernel is 'linear'.
pars   <- valipars(sampling="loocv")
binsvm <- binest(dat,cl,choices=c("setosa","virginica"), method="svm",
                 pars = pars, kernel="linear")

## randomForest with bootstrap
pars  <- valipars(sampling="boot",niter = 5, nreps = 5)
binrf <- binest(dat,cl,choices=c("setosa","virginica"), 
                method="randomForest", pars = pars)

## KNN with randomised validation. The number of neighbours is 3.
pars   <- valipars(sampling="rand",niter = 5, nreps = 5)
binknn <- binest(dat,cl,choices = list(c("setosa","virginica"),
                                       c("virginica","versicolor")), 
                 method="knn",pars = pars, k = 3)

mt documentation built on Feb. 2, 2022, 1:07 a.m.

Related to binest in mt...