Balanced cross-validation for the quantile classifier
quantileCV(x, cl, nfold = min(table(cl)),
folds = balanced.folds(cl, nfold), theta=NULL, seed = 1, varying = FALSE)A list with components
Mean of misclassification errors in the cross-validation test sets for each quantile probability (available if varying is FALSE)
Mean of misclassification errors in the cross-validation train sets for each quantile probability (available if varying is FALSE)
The fitted quantile probabilities
Value of the chosen quantile probability in the training set
Misclassification errors in the cross validation test sets for the best quantile probability
Misclassification errors in the cross validation training sets for the best quantile probability
Misclassification errors in the cross validation test sets of the median classifier
Misclassification errors in the cross validation test sets of the centroid classifier
The cross-validation folds used
A matrix of data (the training 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 (factor or numerical)
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.
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
A vector of quantile probabilities (optional)
Fix the seed of the running. Default is 1
If TRUE a different quantile for each variable is selected in the training set. If FALSE (default) an unique quantile is used.
Christian Hennig, Cinzia Viroli
quantileCV carries out cross-validation for a quantile classifier.
data(ais)
x=ais[,3:13]
cl=as.double(ais[,1])
out=quantileCV(x,cl,nfold=2)
Run the code above in your browser using DataLab