imbDis: imbDis - Imbalanced Discrimination

Description Usage Arguments Value Examples

View source: R/imbDis.R

Description

This function creates an object of type imbDis, an S3 Class. imbDis objects can be passed into the associated methods as arguments. Examples of associated methods are auc, brier and logLoss.

Usage

1
imbDis(labels, pred, case, bins = seq(0.05, 0.5, 0.05))

Arguments

labels

Vector of ground-truth labels.

pred

Vector of predicted probabilities.

case

A value present in the labels argument, that denotes the case class label.

bins

Vector of class imbalance frequencies. Values must be larger than 0 and smaller than 1. Default is seq(0.05, 0.5, 0.05).

Value

A simMetric object - S3 class that contains the input parameters, standardized labels, and sample size.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# using the mtcars dataset
LR = glm(vs ~ mpg + hp + wt, data = mtcars, family = "binomial")
preds = predict(LR, mtcars, type = "response")  # equiv. to LR$fitted.values

# define the imbDis object
imbD = imbDis(mtcars$vs, preds, 1, seq(0.1, 0.9, 0.1))

# metric results
auc(imbD)
brier(imbD)
logLoss(imbD)

ArjunChattoraj10/imbDis documentation built on Jan. 22, 2021, 3:50 p.m.