odds_table: Calculating Odd table

Description Usage Arguments Value Examples

Description

This function calculate a odds table.

Usage

1
odds_table(target, score, nclass = 10, quantile = TRUE, breaks = NULL)

Arguments

target

A numeric binary vector 0,1

score

A numeric vector of predictions

nclass

A numeric input for determinate the number of classes if breaks is not given.

quantile

A boolean to set if the cuts are made by quantile or counts. This parameter is udes if breaks is not given.

breaks

An optional numeric vector to set the intervals to use

Value

A dplyr::data_frame object with the counts, percents and odds

Examples

1
2
3
4
5
6
7
8
9
data(predictions)

score <- round(predictions$score * 1000)
target <- predictions$target

odds_table(target, score, nclass = 5)
odds_table(target, score, nclass = 5, quantile = FALSE)
odds_table(target, score, breaks = c(-Inf, 250, 750, Inf))
 

jbkunst/riskr documentation built on May 18, 2019, 7 p.m.