confusion: Confusion matrix for binary and multi-class models and...

View source: R/extraction.R

confusionR Documentation

Confusion matrix for binary and multi-class models and predictions.

Description

Creates a confusion matrix, valid only for binary and multi-class models and predictions.

Usage

confusion(x, ...)

## S3 method for class 'caretx'
confusion(x, newdata = NULL, scale = c("none", "fraction", "percent"), ...)

## S3 method for class 'predx'
confusion(x, scale = c("none", "fraction", "percent"), ...)

Arguments

x

caretx model or predx prediction object.

...

extra arguments passed to methods.

newdata

newdata test data set.

scale

indicates, how the table is to be scaled:

  • none: returns the counts (default)

  • fraction returns the fraction of all observations

  • percent returns the percent of all observations

Details

confusion() is a S3 generic function.

Value

a list of table object storing the confusion matrices (caretx) or a single table bject representing the confusion matrix (predx). For regression models NULL and a warning is generated.#


PiotrTymoszuk/caretExtra documentation built on Oct. 15, 2023, 10:03 p.m.