Main Content

compactCreditScorecard

Create compactCreditScorecard object for a credit scorecard model

Description

Build a compact credit scorecard model by creating a compactCreditScorecard object from an existing creditscorecard object.

After creating a compactCreditScorecard object, you can use the associated object functions to display points (displaypoints), calculate the probability of default (probdefault), or compute scores (score).

Note

You cannot directly modify a compactCreditScorecard object. To change a compactCreditScorecard object, you must modify the existing creditscorecard object that you used to create the compactCreditScorecard object. You must then use compactCreditScorecard to create a new compactCreditScorecard object.

Creation

Description

example

csc = compactCreditScorecard(sc) creates a compactCreditScorecard object from an existing creditscorecard. You can then use the compactCreditScorecard object with the displaypoints, score, and probdefault functions.

Note

You cannot use a compactCreditScorecard object with the Binning Explorer app.

Input Arguments

expand all

creditscorecard object, specified using an existing creditscorecard object.

Note

To use a creditscorecard object for input, you must first process the object using the autobinning and fitmodel functions. Optionally, you can also use formatpoints for processing.

Data Types: object

Properties

expand all

User-defined description, returned as a character vector or string.

Data Types: char | string

Indicator for which of the two possible values in the response variable correspond to “Good” observations, returned as a character vector, numeric, or logical value.

Data Types: char | double | logical

Name of the response variable, returned as a character vector. The response variable data must be binary, the "Good" or "Bad" indicator.

Data Types: char

Name of the variable used as ID or tag to indicate which column name in the data table contains the row weights, returned as a character vector.

Data Types: char

Numeric predictors in the input creditscorecard object, returned as a cell array of character vectors. The NumericPredictors property includes only the numeric predictors in the fitted creditscorecard object.

Data Types: cell

Names of categorical predictors used in the input creditscorecard object, returned as a cell array of character vectors. The CategoricalPredictors property includes only the categorical predictors in the fitted creditscorecard object.

Data Types: cell

Names of the predictor variables used in the input creditscorecard object, returned as a cell array of character vectors. The PredictorVars property includes only the predictor variable names in the fitted creditscorecard object.

Data Types: cell

Object Functions

displaypointsReturn points per predictor per bin for a compactCreditScorecard object
scoreCompute credit scores for given dataset for a compactCreditScorecard object
probdefaultLikelihood of default for given dataset for a compactCreditScorecard object
validatemodelValidate quality of compact credit scorecard model

Examples

collapse all

To create a compactCreditScorecard object, first create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011).

load CreditCardData.mat 
sc = creditscorecard(data)
sc = 
  creditscorecard with properties:

                GoodLabel: 0
              ResponseVar: 'status'
               WeightsVar: ''
                 VarNames: {'CustID'  'CustAge'  'TmAtAddress'  'ResStatus'  'EmpStatus'  'CustIncome'  'TmWBank'  'OtherCC'  'AMBalance'  'UtilRate'  'status'}
        NumericPredictors: {'CustID'  'CustAge'  'TmAtAddress'  'CustIncome'  'TmWBank'  'AMBalance'  'UtilRate'}
    CategoricalPredictors: {'ResStatus'  'EmpStatus'  'OtherCC'}
           BinMissingData: 0
                    IDVar: ''
            PredictorVars: {'CustID'  'CustAge'  'TmAtAddress'  'ResStatus'  'EmpStatus'  'CustIncome'  'TmWBank'  'OtherCC'  'AMBalance'  'UtilRate'}
                     Data: [1200x11 table]

Before creating a compactCreditScorecard object, you must use autobinning and fitmodel with the creditscorecard object.

sc = autobinning(sc);
sc = fitmodel(sc);
1. Adding CustIncome, Deviance = 1490.8527, Chi2Stat = 32.588614, PValue = 1.1387992e-08
2. Adding TmWBank, Deviance = 1467.1415, Chi2Stat = 23.711203, PValue = 1.1192909e-06
3. Adding AMBalance, Deviance = 1455.5715, Chi2Stat = 11.569967, PValue = 0.00067025601
4. Adding EmpStatus, Deviance = 1447.3451, Chi2Stat = 8.2264038, PValue = 0.0041285257
5. Adding CustAge, Deviance = 1441.994, Chi2Stat = 5.3511754, PValue = 0.020708306
6. Adding ResStatus, Deviance = 1437.8756, Chi2Stat = 4.118404, PValue = 0.042419078
7. Adding OtherCC, Deviance = 1433.707, Chi2Stat = 4.1686018, PValue = 0.041179769

Generalized linear regression model:
    logit(status) ~ 1 + CustAge + ResStatus + EmpStatus + CustIncome + TmWBank + OtherCC + AMBalance
    Distribution = Binomial

Estimated Coefficients:
                   Estimate       SE       tStat       pValue  
                   ________    ________    ______    __________

    (Intercept)    0.70239     0.064001    10.975    5.0538e-28
    CustAge        0.60833      0.24932      2.44      0.014687
    ResStatus        1.377      0.65272    2.1097      0.034888
    EmpStatus      0.88565        0.293    3.0227     0.0025055
    CustIncome     0.70164      0.21844    3.2121     0.0013179
    TmWBank         1.1074      0.23271    4.7589    1.9464e-06
    OtherCC         1.0883      0.52912    2.0569      0.039696
    AMBalance        1.045      0.32214    3.2439     0.0011792


1200 observations, 1192 error degrees of freedom
Dispersion: 1
Chi^2-statistic vs. constant model: 89.7, p-value = 1.4e-16

Use the creditscorecard object with compactCreditScorecard to create a compactCreditScorecard object.

csc = compactCreditScorecard(sc)
csc = 
  compactCreditScorecard with properties:

              Description: ''
                GoodLabel: 0
              ResponseVar: 'status'
               WeightsVar: ''
        NumericPredictors: {'CustAge'  'CustIncome'  'TmWBank'  'AMBalance'}
    CategoricalPredictors: {'ResStatus'  'EmpStatus'  'OtherCC'}
            PredictorVars: {'CustAge'  'ResStatus'  'EmpStatus'  'CustIncome'  'TmWBank'  'OtherCC'  'AMBalance'}

You can then use displaypoints, score, and probdefault with the compactCreditScorecard object.

References

[1] Anderson, R. The Credit Scoring Toolkit. Oxford University Press, 2007.

[2] Refaat, M. Data Preparation for Data Mining Using SAS. Morgan Kaufmann, 2006.

[3] Refaat, M. Credit Risk Scorecards: Development and Implementation Using SAS. lulu.com, 2011.

Version History

Introduced in R2019a