psi_df: psi_df

Description Usage Arguments Details Value Author(s) References Examples

View source: R/psi.r

Description

Compute the psi for all dataset

Usage

1
psi_df(dat_train, dat_test, var_skip = NULL)

Arguments

var_skip

Name of force kept variables, Defaults to NULL

df_train

expected or training variable, should be a factor

df_test

observed or actual variable, should be a factor

Details

Check whether the population on which the model is currently being used is similar to the population that was used to develop it.

Value

psi value

Author(s)

Nguyen Ngoc Binh nguyenngocbinhneu@gmail.com

References

P395, Credit risk analytics - Measurement technique, applications and examples Rules of thumb when using psi:

PSI shift
----------------- ----------------
< 0.1 no significant shift (green traffic light)
0.1 to 0.25 moderate shift (yellow traffic light)
> 0.25 significant shift (red traffic light)

Examples

1
2
3
4
5
6
7
data('hmeq')
library(rsample)
hmeq1 <- hmeq[,c("bad", "reason", "job")]
spl <- rsample::initial_split(hmeq1)
train_df <- training(spl)
test_df <- testing(spl)
psi_df1 <- psi_df(train_df, test_df)

nguyenngocbinh/scorecard.sea documentation built on Jan. 4, 2020, 11:43 a.m.