confusionMatrix2: Confusion Matrix for a caret model

View source: R/misc.R

confusionMatrix2R Documentation

Confusion Matrix for a caret model

Description

This is a wrapper function for confusionMatrix, but it accepts directly a caret model and a data.frame with test data.

Usage

confusionMatrix2(model, ...)

## S3 method for class 'train'
confusionMatrix2(model, testdata = NULL, testy = NULL, ...)

Arguments

model

A model returned by train.

...

Further arguments to confusionMatrix.

testdata

A data.frame with test values to be evaluated. If NULL, training values will be used.

testy

A factor of response variable of testdata. If NULL, it will be guessed from testdata data.frame.

Note

Using confusionMatrix2(model) (without test data) will produce simple training metrics, unlike confusionMatrix(model), which is based on resampling procedure.

See Also

evaluate ROCcurve


correapvf/caretSDM documentation built on June 2, 2022, 8:29 a.m.