auto_scorecard {autoScorecard}R Documentation

Functions to Automatically Generate Scorecards

Description

Functions to Automatically Generate Scorecards

Usage

auto_scorecard(
  feature = accepts,
  key_var = "application_id",
  y_var = "bad_ind",
  sample_rate = 0.7,
  base0 = FALSE,
  points0 = 600,
  odds0 = 1/20,
  pdo = 50,
  k = 2,
  max_depth = 3,
  tree_p = 0.1,
  missing_rate = 0,
  single_var_rate = 1,
  iv_set = 0.02,
  char_to_number = TRUE,
  na.omit = TRUE
)

Arguments

feature

A data.frame with independent variables and target variable.

key_var

A name of index variable name.

y_var

A name of target variable.

sample_rate

Training set sampling percentage.

base0

Whether the scorecard base score is 0.

points0

Base point.

odds0

odds.

pdo

Point-to Double Odds.

k

Each scale doubles the probability of default several times.

max_depth

Set the maximum depth of any node of the final tree, with the root node counted as depth 0. Values greater than 30 rpart will give nonsense results on 32-bit machines.

tree_p

Meet the following conversion formula: minbucket = round( p*nrow( df )).Smallest bucket(rpart):Minimum number of observations in any terminal <leaf> node.

missing_rate

Data missing rate, variables smaller than this setting will be deleted.

single_var_rate

The maximum proportion of a single variable, the variable greater than the setting will be deleted.

iv_set

IV value minimum threshold, variable IV value less than the setting will be deleted.

char_to_number

Whether to convert character variables to numeric.

na.omit

na.omit returns the object with incomplete cases removed.

Value

A list containing data, bins, scorecards and models.

Examples

accepts <- read.csv(system.file("extdata", "accepts.csv", package = "autoScorecard" ))
auto_scorecard1 <- auto_scorecard( feature = accepts[1:2000,], key_var= "application_id",
y_var = "bad_ind",sample_rate = 0.7, points0 = 600, odds0=1/20, pdo = 50, max_depth = 3,
tree_p = 0.1, missing_rate = 0, single_var_rate = 1, iv_set = 0.02,
char_to_number = TRUE , na.omit = TRUE)

[Package autoScorecard version 0.3.0 Index]