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.
quantilecl(train, test, cl, theta = NULL,
cl.test = NULL, skew.correct="Galton")A list with components
Misclassification errors for each quantile probability in the training set
Misclassification errors for each quantile probability in the test set
The list of optimal quantile probabilities for each variable
The quantile probability that gives the less misclassification error in the training set
Misclassification error in the training set
Misclassification error in the test set (only if cl.test is available)
The matrix of data (training set) with observations in rows and variables in columns
The matrix of data (test set) with observations in rows and variables in columns
Predicted classification in the training set
Predicted classification in the test set
The true classification labels in the training set
The true classification labels in the test set (if available)
A matrix of data (the training set) with observations in rows and variables in columns. It can be a matrix or a dataframe.
A matrix of data (the test set) with observations in rows and variables in columns. It can be a matrix or a dataframe.
A vector of class labels for each sample of the training set. It can be factor or numerical.
A vector of quantile probabilities (optional)
If available, a vector of class labels for each sample of the test set (optional)
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
Christian Hennig, Cinzia Viroli
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.
See Also quantilecl.vw
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)
Run the code above in your browser using DataLab