lr_params: Logistic Regression & Scorecard Parameters

Description Usage Arguments Value See Also

View source: R/model_training.R

Description

lr_params is the list of parameters to train a LR model or Scorecard using in training_model. lr_params_search is for searching the optimal parameters of logistic regression,if any parameters of params in lr_params is more than one.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
lr_params(
  tree_control = list(p = 0.02, cp = 1e-08, xval = 5, maxdepth = 10),
  bins_control = list(bins_num = 10, bins_pct = 0.05, b_chi = 0.02, b_odds = 0.1, b_psi
    = 0.03, b_or = 0.15, mono = 0.2, odds_psi = 0.15, kc = 1),
  f_eval = "ks",
  best_lambda = "lambda.ks",
  method = "random_search",
  iters = 10,
  lasso = TRUE,
  step_wise = TRUE,
  score_card = TRUE,
  sp_values = NULL,
  forced_in = NULL,
  obsweight = c(1, 1),
  thresholds = list(cor_p = 0.8, iv_i = 0.02, psi_i = 0.1, cos_i = 0.5),
  ...
)

lr_params_search(
  method = "random_search",
  dat_train,
  target,
  dat_test = NULL,
  occur_time = NULL,
  x_list = NULL,
  prop = 0.7,
  iters = 10,
  tree_control = list(p = 0.02, cp = 0, xval = 1, maxdepth = 10),
  bins_control = list(bins_num = 10, bins_pct = 0.02, b_chi = 0.02, b_odds = 0.1, b_psi
    = 0.05, b_or = 0.1, mono = 0.1, odds_psi = 0.03, kc = 1),
  thresholds = list(cor_p = 0.8, iv_i = 0.02, psi_i = 0.1, cos_i = 0.6),
  step_wise = FALSE,
  lasso = FALSE,
  f_eval = "ks"
)

Arguments

tree_control

the list of parameters to control cutting initial breaks by decision tree. See details at: get_tree_breaks

bins_control

the list of parameters to control merging initial breaks. See details at: select_best_breaks,select_best_class

f_eval

Custimized evaluation function, "ks" & "auc" are available.

best_lambda

Metheds of best lanmbda stardards using to filter variables by LASSO. There are 3 methods: ("lambda.auc", "lambda.ks", "lambda.sim_sign") . Default is "lambda.auc".

method

Method of searching optimal parameters. "random_search","grid_search","local_search" are available.

iters

Number of iterations of "random_search" optimal parameters.

lasso

Logical, if TRUE, variables filtering by LASSO. Default is TRUE.

step_wise

Logical, stepwise method. Default is TRUE.

score_card

Logical, transfer woe to a standard scorecard. If TRUE, Output scorecard, and score prediction, otherwise output probability. Default is TRUE.

sp_values

Vaules will be in separate bins.e.g. list(-1, "missing") means that -1 & missing as special values.Default is NULL.

forced_in

Names of forced input variables. Default is NULL.

obsweight

An optional vector of 'prior weights' to be used in the fitting process. Should be NULL or a numeric vector. If you oversample or cluster diffrent datasets to training the LR model, you need to set this parameter to ensure that the probability of logistic regression output is the same as that before oversampling or segmentation. e.g.:There are 10,000 0 obs and 500 1 obs before oversampling or under-sampling, 5,000 0 obs and 3,000 1 obs after oversampling. Then this parameter should be set to c(10000/5000, 500/3000). Default is NULL..

thresholds

Thresholds for selecting variables.

  • cor_p The maximum threshold of correlation. Default: 0.8.

  • iv_i The minimum threshold of IV. 0.01 to 0.1 usually work. Default: 0.02

  • psi_i The maximum threshold of PSI. 0.1 to 0.3 usually work. Default: 0.1.

  • cos_i cos_similarity of posive rate of train and test. 0.7 to 0.9 usually work.Default: 0.5.

...

Other parameters

dat_train

data.frame of train data. Default is NULL.

target

name of target variable.

dat_test

data.frame of test data. Default is NULL.

occur_time

The name of the variable that represents the time at which each observation takes place.Default is NULL.

x_list

names of independent variables. Default is NULL.

prop

Percentage of train-data after the partition. Default: 0.7.

Value

A list of parameters.

See Also

training_model, xgb_params, gbm_params, rf_params


creditmodel documentation built on Jan. 7, 2022, 5:06 p.m.