confusion_matrix: Build a confusion matrix

View source: R/confusion_matrix.R

confusion_matrixR Documentation

Build a confusion matrix

Description

Build a confusion matrix

Usage

confusion_matrix(pred, true)

cm(pred, true)

Arguments

pred

vector of predicted classes.

true

vector of true classes.

Value

A table object with true values in lines and predicted values in columns

Examples

res <- mutate(mtcars, cyl=factor(cyl)) %>%
  resample_split(p=0.5) %>%
  xgb_fit(resp="cyl", expl=c("mpg", "hp", "qsec"), nrounds=20) %>%
  xgb_predict(fns=NULL)
confusion_matrix(res$pred, res$cyl)

jiho/joml documentation built on Dec. 6, 2023, 5:50 a.m.