reclassification: Reclassification

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/reclassification.R

Description

This function performs Reject Inference using the Reclassification technique. Note that this technique has no theoretical foundation as it performs a one-step CEM algorithm.

Usage

1
reclassification(xf, xnf, yf, thresh = 0.5)

Arguments

xf

The matrix of financed clients' characteristics to be used in the scorecard.

xnf

The matrix of not financed clients' characteristics to be used in the scorecard (must be the same in the same order as xf!).

yf

The matrix of financed clients' labels

thresh

The threshold to use in the Classification step, i.e. the probability above which a not financed client is considered to have a label equal to 1.

Details

This function performs the Reclassification method on the data. When provided with labeled observations (x^\ell,y), it first fits the logistic regression model p_θ of x^\ell on y, then considers that unlabeled observations are of the expected class given by the model p_θ (this is equivalent to a CEM algorithm). It then refits a logistic regression model p_η on the whole sample.

Value

List containing the model using financed clients only and the model produced using the Reclassification method.

Author(s)

Adrien Ehrhardt

References

Enea, M. (2015), speedglm: Fitting Linear and Generalized Linear Models to Large Data Sets, https://CRAN.R-project.org/package=speedglm Ehrhardt, A., Biernacki, C., Vandewalle, V., Heinrich, P. and Beben, S. (2018), Reject Inference Methods in Credit Scoring: a rational review,

See Also

glm, speedglm

Examples

1
2
3
4
5
6
7
8
# We simulate data from financed clients
xf <- matrix(runif(100 * 2), nrow = 100, ncol = 2)
theta <- c(2, -2)
log_odd <- apply(xf, 1, function(row) theta %*% row)
yf <- rbinom(100, 1, 1 / (1 + exp(-log_odd)))
# We simulate data from not financed clients (MCAR mechanism)
xnf <- matrix(runif(100 * 2), nrow = 100, ncol = 2)
reclassification(xf, xnf, yf)

scoringTools documentation built on Jan. 13, 2021, 8:35 p.m.