quantilecl: A function that applies the quantile classifier for a given...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/quantilecl.R

Description

The function applies the quantile classifier for a set of quantile probabilities and selects the optimal probability that minimize the misclassification rate in the training set.

Usage

1
2
quantilecl(train, test, cl, theta = NULL, 
cl.test = NULL, skew.correct="Galton")

Arguments

train

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

test

A matrix of data (the test 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 of the training set. It can be factor or numerical.

theta

A vector of quantile probabilities (optional)

cl.test

If available, a vector of class labels for each sample of the test set (optional)

skew.correct

Skewness measures applied to correct the skewness direction of the variables. The possibile choices are: Galton's skewness (default), Kelley's skewness and the conventional skewness index based on the third standardized moment

Details

quantile_cl carries out the quantile classifier for a set of quantile probabilities and selects the optimal probability that minimize the misclassification rate in the training set. The values of the quantile probabilities can be given in input or automatically selected in a equispaced range of 49 values between 0 and 1. The data in the training and test samples are preprocessed so that the variables used for the quantile estimator all have the same (positive) direction of skewness according to different measures of skewness: Galton's skewness, Kelley's skewness or conventional skewness index.

Value

A list with components

train.rates

Misclassification errors for each quantile probability in the training set

test.rates

Misclassification errors for each quantile probability in the test set

thetas

The list of optimal quantile probabilities for each variable

theta.choice

The quantile probability that gives the less misclassification error in the training set

me.train

Misclassification error in the training set

me.test

Misclassification error in the test set (only if cl.test is available)

train

The matrix of data (training set) with observations in rows and variables in columns

test

The matrix of data (test set) with observations in rows and variables in columns

cl.train

Predicted classification in the training set

cl.test

Predicted classification in the test set

cl.train.0

The true classification labels in the training set

cl.test.0

The true classification labels in the test set (if available)

Author(s)

Christian Hennig, Cinzia Viroli

See Also

See Also quantilecldiff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(ais)
x=ais[,3:13]
cl=as.double(ais[,1])
set.seed(22)
index=sample(1:202,152,replace=FALSE)
train=x[index,]
test=x[-index,]
cl.train=cl[index]
cl.test=cl[-index]
out.q=quantilecl(train,test,cl.train,cl.test=cl.test)
out.q$me.test
print(out.q)
plot(out.q)

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