binest {mt} | R Documentation |
Binary Classification
Description
Binary classification.
Usage
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 |
method |
Classification method to be used. For details, see
|
pars |
A list of parameters of the resampling method. For details, see
|
... |
Additional parameters to |
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 |
Author(s)
Wanchang Lin
See Also
Examples
# 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)
[Package mt version 2.0-1.20 Index]