Description Usage Arguments Value See Also Examples
View source: R/confusionTable.R
Confusion table and class assignments of one cascade.
1 2 3 4 5 6 | confusionTable(
predictionMap = NULL,
cascade = NULL,
other.classes = NULL,
sort = TRUE
)
|
predictionMap |
A PredictionMap object as it is returned by |
cascade |
A numeric vector of classes or a character string of type '1>2>3' of at least two class labels reflected in 'predictionMap'. |
other.classes |
This parameter can be either NULL, 'all' or a numeric vector of classes that are not part of the cascade parameter. If other.classes is: - NULL, only the cascade classes are evaluated. - 'all', all remaining classes are evaluated. - a vector of classes, those classes are evaluated. |
sort |
If TRUE (default) the classes that are not part of cascade are sorted based on their confusion. |
An object of type ConfusionTable including the sensitivities, with the label of the predicted classes in the rows and the labels of the original class in the columns.
summary.ConfusionTable
, print.ConfusionTable
, plot.ConfusionTable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(TunePareto)
data(esl)
data = esl$data
labels = esl$labels
foldList = generateCVRuns(labels = labels,
ntimes = 2,
nfold = 2,
leaveOneOut = FALSE,
stratified = TRUE)
predMap = predictionMap(data, labels, foldList = foldList,
classifier = tunePareto.svm(), kernel='linear')
# Calculation of the confusion matrix for '0>2>3>4'.
confTable = confusionTable(predMap, cascade = '0>2>3>4')
# Calculation of the confusion matrix for '0>2>3>4'
# and the assignment of all samples of the other classes.
confTable = confusionTable(predMap, cascade = '0>2>3>4',
other.classes='all', sort = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.