Learn R Programming

fastLogisticRegressionWrap (version 1.2.0)

confusion_results: Binary Confusion Table and Errors

Description

Provides a binary confusion table and error metrics

Usage

confusion_results(yhat, ybin, skip_argument_checks = FALSE)

Value

A list of raw results

Arguments

yhat

The binary predictions

ybin

The true binary responses

skip_argument_checks

If TRUE it does not check this function's arguments for appropriateness. It is not recommended unless you truly need speed and thus the default is FALSE.

Examples

Run this code
library(MASS); data(Pima.te)
ybin = as.numeric(Pima.te$type == "Yes")
flr = fast_logistic_regression(
  Xmm = model.matrix(~ . - type, Pima.te), 
  ybin = ybin
)
phat = predict(flr, model.matrix(~ . - type, Pima.te))
confusion_results(phat > 0.5, ybin)

Run the code above in your browser using DataLab