confusion: Confusion matrix

Description Usage Arguments Details Value See Also Examples

View source: R/evalbin.R

Description

Confusion matrix

Usage

1
2
confusion(dataset, pred, rvar, lev = "", cost = 1, margin = 2,
  train = "All", data_filter = "", ...)

Arguments

dataset

Dataset

pred

Predictions or predictors

rvar

Response variable

lev

The level in the response variable defined as success

cost

Cost for each connection (e.g., email or mailing)

margin

Margin on each customer purchase

train

Use data from training ("Training"), validation ("Validation"), both ("Both"), or all data ("All") to evaluate model evalbin

data_filter

Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")

...

further arguments passed to or from other methods

Details

Confusion matrix and additional metrics to evaluate binary classification models. See https://radiant-rstats.github.io/docs/model/evalbin.html for an example in Radiant

Value

A list of results

See Also

summary.confusion to summarize results

plot.confusion to plot results

Examples

1
2
3
data.frame(buy = dvd$buy, pred1 = runif(20000), pred2 = ifelse(dvd$buy == "yes", 1, 0)) %>%
  confusion(c("pred1", "pred2"), "buy") %>%
  str()

radiant-rstats/radiant.model documentation built on Nov. 13, 2018, 7 a.m.