modifypredictor
Set properties of credit scorecard predictors
Description
sc = modifypredictor(sc,PredictorName)
sc = modifypredictor(___,Name,Value)
Examples
Create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011). In practice, categorical data many times is represented with numeric values. To show the case where categorical data is given as numeric data, the data for the variable 'ResStatus' is intentionally converted to numeric values. 
load CreditCardData data.ResStatus = double(data.ResStatus); 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'  'ResStatus'  'CustIncome'  'TmWBank'  'AMBalance'  'UtilRate'}
    CategoricalPredictors: {'EmpStatus'  'OtherCC'}
           BinMissingData: 0
                    IDVar: 'CustID'
            PredictorVars: {'CustAge'  'TmAtAddress'  'ResStatus'  'EmpStatus'  'CustIncome'  'TmWBank'  'OtherCC'  'AMBalance'  'UtilRate'}
                     Data: [1200×11 table]
[T,Stats] = predictorinfo(sc,'ResStatus')T=1×4 table
                 PredictorType      LatestBinning      LatestFillMissingType    LatestFillMissingValue
                 _____________    _________________    _____________________    ______________________
    ResStatus     {'Numeric'}     {'Original Data'}        {'Original'}              {0×0 double}     
Stats=4×1 table
             Value 
            _______
    Min           1
    Max           3
    Mean     1.7017
    Std     0.71833
Note that 'ResStatus' appears as part of the NumericPredictors property. Assume that you want 'ResStatus' to be treated as categorical data. For example, you may want to allow automatic binning algorithms to reorder the categories. Use modifypredictor to change the 'PredictorType' of the PredictorName 'ResStatus' from numeric to categorical. 
sc = modifypredictor(sc,'ResStatus','PredictorType','Categorical')
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: [1200×11 table]
[T,Stats] = predictorinfo(sc,'ResStatus')T=1×5 table
                  PredictorType     Ordinal      LatestBinning      LatestFillMissingType    LatestFillMissingValue
                 _______________    _______    _________________    _____________________    ______________________
    ResStatus    {'Categorical'}     false     {'Original Data'}        {'Original'}              {0×0 double}     
Stats=3×1 table
          Count
          _____
    C1     542 
    C2     474 
    C3     184 
Notice that 'ResStatus' now appears as part of the 'Categorical' predictors. 
Input Arguments
Credit scorecard model, specified as a
                                creditscorecard object. Use creditscorecard to create
                            a creditscorecard object.
Predictor name, specified using a character vector or cell array of
                            character vectors containing the names of the credit scorecard
                            predictors. PredictorName is case-sensitive.
Data Types: char | cell
Name-Value Arguments
Specify optional pairs of arguments as
      Name1=Value1,...,NameN=ValueN, where Name is
      the argument name and Value is the corresponding value.
      Name-value arguments must appear after other arguments, but the order of the
      pairs does not matter.
    
      Before R2021a, use commas to separate each name and value, and enclose 
      Name in quotes.
    
Example: sc =
                        modifypredictor(sc,{'CustAge','CustIncome'},'PredictorType','Categorical','Ordinal',true)
Predictor type that one or more predictors are converted to,
                            specified as the comma-separated pair consisting of
                                'PredictorType' and a character vector. Possible
                            values are:
- ''— No conversion occurs.
- 'Numeric'— The predictor data specified by- PredictorNameis converted to numeric.
- 'Categorical'— The predictor data specified by- PredictorNameis converted to categorical.
Data Types: char
Indicator for whether predictors being converted to categorical or
                            existing categorical predictors are treated as ordinal data, specified
                            as the comma-separated pair consisting of 'Ordinal'
                            and a logical with values true or
                                false.
Note
This optional input parameter is only used for predictors of
                                    type 'Categorical'.
Data Types: logical
Output Arguments
Credit scorecard model, returned as an updated
                                creditscorecard object.
Version History
Introduced in R2015b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)