bin: bin

Description Usage Arguments Details Value

Description

The starting point for any binnr scorecard. The bin function prepares variables for scorecard modeling by returning a Scorecard-class object that is easily manipulated.

Usage

1
2
bin(data, y, w = rep(1, length(y)), min.iv = 0.001, min.cnt = 25,
  min.res = 5, mono = 0, max.bin = 10, exceptions = numeric(0))

Arguments

data

data.frame of independent predictors to discretize. Can only bin factors and numeric columns. All other data types are removed from the scorecard object.

y

Response variable. Currently, only binary performance is supported.

w

Weight variable. If omitted, a weight variable of all 1s is created.

min.iv

The minimum information value to split a continuous variable.

min.cnt

The minumum number of observations that must be in a bin after any split.

min.res

The minimum number of response observations that must be in a bin after any split.

mono

Monotonicity constraint

  • 0 No monotoncity enforced - the default.

  • 1 Increasing monotoncically with the y

  • -1 Decreasing monotoncically with the y

  • 2 Either increasing or decreasing montonically with the y

max.bin

The maximum number of bins into which x is discretized.

exceptions

A numeric vector of values to be excluded from the discretization process.

Details

bin Is the workhorse of binnr Depending on the input variable class type, it will behave differently. For numeric and integer variables it will discretize using information value. The returned object is of class Continuous. Factors are summarized and passed through as-is. The returned object for factors if of class Discrete.

The operations that can be performed on a bin depend on its class. Continuous bins are subject to the constratins passed into the bin functions. Furthermore, only adjacent levels may be collapsed. Discrete bins are not constrained by the bin function parameters and non-adjacent levels may be collapsed.

Missing values are always held out of binning. They may be combined only if the variable was binned as discrete.

Value

A Scorecard object with data variables discretized.


Zelazny7/binnr documentation built on May 10, 2019, 1:55 a.m.