profit: Calculate Profit based on cost:margin ratio

profitR Documentation

Calculate Profit based on cost:margin ratio

Description

Calculate Profit based on cost:margin ratio

Usage

profit(pred, rvar, lev, cost = 1, margin = 2)

Arguments

pred

Prediction or predictor

rvar

Response variable

lev

The level in the response variable defined as success

cost

Cost per treatment (e.g., mailing costs)

margin

Margin, or benefit, per 'success' (e.g., customer purchase). A cost:margin ratio of 1:2 implies the cost of False Positive are equivalent to the benefits of a True Positive

Value

profit

Examples

profit(runif(20000), dvd$buy, "yes", cost = 1, margin = 2)
profit(ifelse(dvd$buy == "yes", 1, 0), dvd$buy, "yes", cost = 1, margin = 20)
profit(ifelse(dvd$buy == "yes", 1, 0), dvd$buy)

radiant-rstats/radiant.model documentation built on Nov. 29, 2023, 5:59 a.m.