Main Content

predictorinfo

Summary of credit scorecard predictor properties

Description

[T,Stats] = predictorinfo(sc,PredictorName) returns a summary of credit scorecard predictor properties and some basic predictor statistics.

example

Examples

collapse all

Create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011).

load CreditCardData
sc = creditscorecard(data,'IDVar','CustID')
sc = 
  creditscorecard with properties:

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

Obtain the predictor statistics for the PredictorName of CustAge.

[T,Stats] = predictorinfo(sc,'CustAge')
T=1×4 table
               PredictorType      LatestBinning      LatestFillMissingType    LatestFillMissingValue
               _____________    _________________    _____________________    ______________________

    CustAge     {'Numeric'}     {'Original Data'}        {'Original'}              {0x0 double}     

Stats=4×1 table
            Value 
            ______

    Min         21
    Max         74
    Mean    45.174
    Std     9.8302

Obtain the predictor statistics for the PredictorName of ResStatus.

[T,Stats] = predictorinfo(sc,'ResStatus')
T=1×5 table
                  PredictorType     Ordinal      LatestBinning      LatestFillMissingType    LatestFillMissingValue
                 _______________    _______    _________________    _____________________    ______________________

    ResStatus    {'Categorical'}     false     {'Original Data'}        {'Original'}              {0x0 double}     

Stats=3×1 table
                  Count
                  _____

    Home Owner     542 
    Tenant         474 
    Other          184 

Create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011).

load CreditCardData
sc = creditscorecard(dataMissing,'BinMissingData',true,'IDVar','CustID');
sc = autobinning(sc);

Use fillmissing to replace missing values for the CustAge predictor with a value of 38.

sc = fillmissing(sc,'CustAge','constant',38);

Obtain the predictor statistics for the PredictorName of CustAge.

[T,Stats] = predictorinfo(sc,'CustAge')
T=1×4 table
               PredictorType         LatestBinning          LatestFillMissingType    LatestFillMissingValue
               _____________    ________________________    _____________________    ______________________

    CustAge     {'Numeric'}     {'Automatic / Monotone'}        {'Constant'}                 {[38]}        

Stats=4×1 table
            Value 
            ______

    Min         21
    Max         74
    Mean    44.932
    Std     9.7436

Use fillmissing to replace missing values for the ResStatus predictor with a mode value.

sc = fillmissing(sc,'ResStatus','mode');

Obtain the predictor statistics for the PredictorName of ResStatus.

[T,Stats] = predictorinfo(sc,'ResStatus')
T=1×5 table
                  PredictorType     Ordinal         LatestBinning          LatestFillMissingType    LatestFillMissingValue
                 _______________    _______    ________________________    _____________________    ______________________

    ResStatus    {'Categorical'}     false     {'Automatic / Monotone'}          {'Mode'}               {'Home Owner'}    

Stats=3×1 table
                  Count
                  _____

    Tenant         457 
    Home Owner     563 
    Other          180 

Input Arguments

collapse all

Credit scorecard model, specified as a creditscorecard object. Use creditscorecard to create a creditscorecard object.

Predictor name, specified using a character vector containing the names of the credit scorecard predictor of interest. PredictorName is case-sensitive.

Data Types: char

Output Arguments

collapse all

Summary information for specified predictor, returned as table with the following columns:

  • 'PredictorType''Numeric' or 'Categorical'.

  • 'Ordinal' — For categorical predictors, a boolean indicating whether it is ordinal.

  • 'LatestBinning' — Character vector indicating the last applied algorithm for the input argument PredictorName. The values are:

    • 'Original Data' — When no binning is applied to the predictor.

    • 'Automatic / BinningName' — Where 'BinningName' is one of the following: Monotone, Equal Width, or Equal Frequency.

    • 'Manual' — After each call of modifybins, where either 'CutPoints', 'CatGrouping', 'MinValue', or 'MaxValue' are modified.

  • 'LatestFillMissingType' — If fillmissing has been applied to the predictor, the value of the Statistics argument for fillmissing is displayed. If the predictor does not have any missing data, then the fill type is 'Original'.

  • 'LatestFillMissingValue' — If fillmissing has been applied to the predictor, the fill value is displayed. If the predictor does not have any missing data, then the fill value is [ ].

The predictor’s name is used as a row name in the table that is returned.

Summary statistics for the input PredictorName, returned as a table. The corresponding value is stored in the 'Value' column.

The table’s row names indicate the relevant statistics for numeric predictors:

  • 'Min' — Minimum value in the sample.

  • 'Max' — Maximum value in the sample.

  • 'Mean' — Mean value in the sample.

  • 'Std' — Standard deviation of the sample.

    Note

    For data types other than 'double' or 'single', numeric precision may be lost for the standard deviation. Data types other than 'double' or 'single' are cast as 'double' before computing the standard deviation.

For categorical predictors, the row names contain the names of the categories, with corresponding total count in the 'Count' column.

Version History

Introduced in R2015b