quantileCV: A function to cross-validate the quantile classifier

Description Usage Arguments Details Value Author(s) Examples

View source: R/quantileCV.R

Description

Balanced cross-validation for the quantile classifier

Usage

1
2
quantileCV(x, cl, nfold = min(table(cl)), 
folds = balanced.folds(cl, nfold), theta=NULL, seed = 1, varying = FALSE)

Arguments

x

A matrix of data (the training set) with observations in rows and variables in columns (it can be a matrix or a dataframe)

cl

A vector of class labels for each sample (factor or numerical)

nfold

Number of cross-validation folds. Default is the smallest class size. Admitted values are from 1 to the smallest class size as maximum fold number.

folds

A list with nfold components, each component a vector of indices of the samples in that fold. By default a (random) balanced cross-validation is used

theta

A vector of quantile probabilities (optional)

seed

Fix the seed of the running. Default is 1

varying

If TRUE a different quantile for each variable is selected in the training set. If FALSE (default) an unique quantile is used.

Details

quantileCV carries out cross-validation for a quantile classifier.

Value

A list with components

test.rates

Mean of misclassification errors in the cross-validation test sets for each quantile probability (available if varying is FALSE)

train.rates

Mean of misclassification errors in the cross-validation train sets for each quantile probability (available if varying is FALSE)

thetas

The fitted quantile probabilities

theta.choice

Value of the chosen quantile probability in the training set

me.test

Misclassification errors in the cross validation test sets for the best quantile probability

me.train

Misclassification errors in the cross validation training sets for the best quantile probability

me.median

Misclassification errors in the cross validation test sets of the median classifier

me.centroid

Misclassification errors in the cross validation test sets of the centroid classifier

folds

The cross-validation folds used

Author(s)

Christian Hennig, Cinzia Viroli

Examples

1
2
3
4
data(ais)
x=ais[,3:13]
cl=as.double(ais[,1])
out=quantileCV(x,cl,nfold=2)

quantileDA documentation built on May 2, 2019, 5:54 a.m.