Estimate a Resampled Confusion Matrix
"confusionMatrix"(data, norm = "overall", dnn = c("Prediction", "Reference"), ...)"confusionMatrix"(data, norm = "overall", dnn = c("Prediction", "Reference"), ...)"confusionMatrix"(data, norm = "overall", dnn = c("Prediction", "Reference"), ...)
- An object of class
sbfthat did not use out-of-bag resampling or leave-one-out cross-validation.
- A character string indicating how the table entries should be normalized. Valid values are "none", "overall" or "average".
- A character vector of dimnames for the table
- not used here
train is used for tuning a model, it tracks the confusion matrix cell entries for the hold-out samples. These can be aggregated and used for diagnostic purposes. For
train, the matrix is estimated for the final model tuning parameters determined by
rfe, the matrix is associated with the optimal number of variables.
There are several ways to show the table entries. Using
norm = "none" will show the aggregated counts of samples on each of the cells (across all resamples). For
norm = "average", the average number of cell counts across resamples is computed (this can help evaluate how many holdout samples there were on average). The default is
norm = "overall", which is equivalento to
"average" but in percentages.
a list of class
- the normalized matrix
- an echo fo the call
- a character string with details about the resampling procedure (e.g. "Bootstrapped (25 reps) Confusion Matrix"
data(iris) TrainData <- iris[,1:4] TrainClasses <- iris[,5] knnFit <- train(TrainData, TrainClasses, method = "knn", preProcess = c("center", "scale"), tuneLength = 10, trControl = trainControl(method = "cv")) confusionMatrix(knnFit) confusionMatrix(knnFit, "average") confusionMatrix(knnFit, "none")