主要内容

解决信用记分卡结果问题

本主题显示使用需要故障排除的信用记分卡时的一些结果。这些示例涵盖了信用评分卡工作流程的全部范围。有关创建和发展信用记分卡的整体流程的详细信息,请参见信用记分卡建模工作流

预测器名称未指定,解析器返回错误

如果你试图使用modifybinsbininfo,或plotbins并且省略预测器的名称,解析器将返回一个错误。

负载CreditCardDataSc =信用记分卡(数据,“IDVar”“CustID”“GoodLabel”, 0);modifybins (sc,“割点”,[20 30 50 65])
使用creditscorecard/modifybins错误(第79行),期望参数名称为字符串,而不是输入类型为'double'。

解决方案:在使用这些函数时,请确保包含预测器的名称。使用此语法指定PredictorName当使用modifybins

负载CreditCardDataSc =信用记分卡(数据,“IDVar”“CustID”“GoodLabel”, 0);modifybins (sc,“CustIncome”“割点”,[20 30 50 65]);

使用bininfoplotbins在装箱之前

如果你使用bininfoplotbins在装箱之前,结果可能无法使用。

负载CreditCardDataSc =信用记分卡(数据,“IDVar”“CustID”“GoodLabel”, 0);bininfo (sc,“CustAge”) plotbins (sc,“CustAge”
ans =本好不好悲哀InfoValue几率  ________ ____ ___ _______ _________ __________ ' 21 ' 2 1 2 -0.011271 - 3.1821 e-07 ' 22 ' 3 1 3 0.39419 - 0.00047977 23 ' 1 2 0.5 -1.3976 0.0053002 ' 24 ' 3 4 0.75 -0.9921 0.0062895 ' 25 ' 3 1 3 0.39419 - 0.00047977”26日的4 2 2 -0.011271 - 6.3641 e-07 27的6 5 1.2 -0.5221 0.0026744 28“10 2 5 0.90502 - 0.0067112”29日8 6 1.3333 -0.41674 0.0021465的30 9 10 0.9 -0.80978 0.011321的31 8 6 1.3333 -0.41674 0.0021465的32”13 13 1 -0.70442 0.011663“33”9 11 0.81818 - -0.9050914 12 1.1667 -0.55027 0.0070391 0.014934“34”“35”18日十1.8 -0.11663 0.00032342“36”23日14 1.6429 -0.20798 0.0013772“37”28日19 1.4737 -0.31665 0.0041132“38”24日14 1.7143 -0.16542 0.0008894“39”21日14 1.5 -0.29895 0.0027242“40”31日12 2.5833 0.24466 0.0020499“41”21日18 1.1667 -0.55027 0.010559“42”29日9 3.2222 0.46565 0.0062605“43”29日23日1.2609 -0.47262 0.010312“44”28日16 1.75 -0.1448 0.00078672“45”36 16 2.25 0.10651 0.00048246“46”33 19 1.7368 -0.15235 0.0010303“47”28日6 4.6667 - 0.836030.016516 '48' 32 17 1.8824 -0.071896 0.00021357 '49' 38 10 3.8 0.63058 0.013957 '50' 33 14 2.3571 0.15303 0.00089239 '51' 28 9 3.1111 0.43056 0.0052525 '52' 35 8 4.375 0.77149 0.01808 '53' 14 8 1.75 -0.1448 0.00039336 '54' 27 12 2.25 0.10651 0.00036184 '55' 20 9 2.2222 0.094089 0.00021044 '56' 20 11 1.8182 -0.10658 0.00029856 '57' 16 7 2.2857 0.12226 0.00028035 '58' 11 7 1.5714 -0.25243 0.00099297 '59' 11 6 1.8333 -0.098283 0.00013904 '60' 9 4 2.25 0.10651 0.00012061 '61' 11 2 5.5 1.0003 0.0086637 '62' 8 0 Inf Inf Inf '63' 7 1 7 1.2415 0.0076953 '64' 10 0 Inf Inf Inf '65' 4 1 4 0.68188 0.0016791 '66' 6 1 6 1.0873 0.0053857 '67' 2 3 0.66667 -1.1099 0.0056227 '68' 6 1 6 1.0873 0.0053857 '69' 6 0 Inf Inf Inf '70' 1 0 Inf Inf Inf '71' 1 0 Inf Inf Inf '72' 1 0 Inf Inf Inf '73' 3 0 Inf Inf Inf '74' 1 0 Inf Inf Inf 'Totals' 803 397 2.0227 NaN Inf

图CustAge演示时,有太多的箱子

的情节CustAge不可读,因为它有太多的箱子。同时,bininfo返回包含以下内容的数据WOE的值,因为两者的观测均为零

解决方案: Bin数据usingautobinningmodifybins在绘制或查询容器统计信息之前,要避免有太多的容器或年代和例如,您可以使用的名称-值对参数AlgoOptionsautobinning函数定义箱子的数量。

负载CreditCardDataSc =信用记分卡(数据,“IDVar”“CustID”“GoodLabel”, 0);AlgoOptions = {“NumBins”4};Sc = autobinning(Sc,“CustAge”“算法”“EqualFrequency”...“AlgorithmOptions”, AlgoOptions);bininfo (sc,“CustAge”“总数”“关闭”) plotbins (sc,“CustAge”
ans =本好不好悲哀InfoValue几率  ___________ ____ ___ ______ ________ _________ '[- 正无穷,39)186 133 1.3985 -0.36902 0.03815[39岁,46)的195 108 1.8056 -0.11355 0.0033158[46岁,52)“192 75 2.56 0.23559 0.011823”(52岁,正无穷)230 81 2.8395 0.33921 0.02795

在使用autobinning函数后,使用适当数量的箱子绘制CustAge

如果分类数据以数字形式给出

分类数据通常使用数值来记录,并且可以存储在数值数组中。虽然您知道数据应该被解释为分类信息,但对于creditscorecard这个预测器看起来像一个数字数组。

为了显示分类数据作为数值数据给出的情况,变量的数据ResStatus有意转换为数值。

负载CreditCardData数据。ResStatus = double(data.ResStatus);Sc =信用记分卡(数据,“IDVar”“CustID”
sc = creditscorecard与属性:GoodLabel: 0 responseval: 'status' VarNames: {1x11 cell} NumericPredictors: {1x7 cell} CategoricalPredictors: {'EmpStatus' 'OtherCC'} IDVar: 'CustID' PredictorVars: {1x9 cell}

请注意,“ResStatus”的一部分NumericPredictors财产。如果应用了自动分箱,则生成的分箱信息会提示有关预测器类型的标志。

Sc = autobinning(Sc,“ResStatus”);[bi,cg] = bininfo(sc,“ResStatus”
bi = Bin好坏赔率WOE InfoValue __________ _______ ______ _________ __________ '[-Inf,2)' 365 177 2.0621 0.019329 0.0001682 '[2,Inf]' 438 220 1.9909 -0.015827 0.00013772 '总计' 803 397 2.0227 NaN 0.00030592 cg = 2

bin标签中的数值范围显示了这一点“ResStatus”被视为数值变量。的可选输出也证实了这一点bininfo是切割点的数字数组,而不是具有类别分组的表。此外,输出从predictorinfo确认信用记分卡将数据视为数字。

[T,Stats] = predictorinfo(sc,“ResStatus”
T = PredictorType LatestBinning  _____________ ______________________ ResStatus“数值”“自动/单调”统计=值最小1最大3平均1.7017性病0.71863

解决方案:对于creditscorecard“分类”意思是MATLAB®分类数据类型。有关更多信息,请参见分类.治疗“ResStatus”作为分类,更改“PredictorType”PredictorName“ResStatus”“数字”“分类”使用modifypredictor

Sc = modifypredictor(Sc,“ResStatus”“PredictorType”“分类”) [T,Stats] = predictorinfo(sc,“ResStatus”
sc = creditscorecard与属性:GoodLabel: 0 responseval: 'status' VarNames: {1x11 cell} NumericPredictors: {1x6 cell} CategoricalPredictors: {'ResStatus' 'EmpStatus' 'OtherCC'} IDVar: 'CustID' PredictorVars: {1x9 cell} T = PredictorType Ordinal LatestBinning _____________ _______ _______________ ResStatus' Categorical' false 'Original Data' Stats = Count _____ C1 542 C2 474 C3 184

请注意,“ResStatus”现在作为直言预测符的一部分出现。同时,predictorinfo现在描述“ResStatus”为类别,并显示类别计数。

如果你申请autobinning,类别现在重新排序,如调用所示bininfo,它还显示类别标签,而不是数字范围。的可选输出bininfo现在是一个类别分组表。

Sc = autobinning(Sc,“ResStatus”);[bi,cg] = bininfo(sc,“ResStatus”
bi = Bin好坏赔率WOE InfoValue ________ _______ ______ _________ _________ 'C2' 307 167 1.8383 -0.095564 0.0036638 'C1' 365 177 2.0621 0.019329 0.0001682 'C3' 131 53 2.4717 0.20049 0.0059418 '总计' 803 397 2.0227 NaN 0.0097738 cg =类别BinNumber ________ _________ 'C2' 1' C1' 2' C3' 3

在对“测试”数据集进行评分时返回

当应用creditscorecard模型到“测试”数据集分数函数,如果“test”数据集中的观测值具有<定义>值,对于这些观察结果,将返回总分。例如,creditscorecard对象使用“训练”数据创建。

负载CreditCardDataSc =信用记分卡(数据,“IDVar”“CustID”);Sc = autobinning(Sc);Sc = fitmodel(Sc);
1.添加CustIncome, Deviance = 1490.8527, Chi2Stat = 32.588614, PValue = 1.1387992e-08添加TmWBank, Deviance = 1467.1415, Chi2Stat = 23.711203, PValue = 1.1192909e-063 .添加AMBalance, Deviance = 1455.5715, Chi2Stat = 11.569967, PValue = 0.00067025601。5.添加EmpStatus, Deviance = 1447.3451, Chi2Stat = 8.2264038, PValue = 0.0041285257。添加CustAge, Deviance = 1441.994, Chi2Stat = 5.3511754, PValue = 0.020708306添加ResStatus, Deviance = 1437.8756, Chi2Stat = 4.118404, PValue = 0.042419078。添加OtherCC, Deviance = 1433.707, Chi2Stat = 4.1686018, PValue = 0.041179769广义线性回归模型:logit(status) ~ 1 + CustAge + ResStatus + EmpStatus + CustIncome + TmWBank + OtherCC + AMBalance分布=二项估计系数:估计SE tStat pValue ________ ________ ______ __________(拦截)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观测值,1192误差自由度离散度:1 Chi^2统计与常数模型:89.7, p-value = 1.4e-16

假设一个缺失的观察()添加到数据中,然后newdata是使用分数函数。默认情况下,分配给缺失值的点和分数为

Newdata =数据(1:10,:);newdata.CustAge(1) = NaN;[score,Points] = score(sc,newdata)
Scores = NaN 1.4646 0.7662 1.5779 1.4535 1.8944 -0.0872 0.9207 1.0399 0.8252 Points = CustAge ResStatus EmpStatus CustIncome TmWBank OtherCC AMBalance ________ _________ _________ __________ _________ ________ _________ NaN -0.031252 -0.076317 0.43693 0.39607 0.15842 - 0.012696 0.31449 0.43693 -0.033752 0.15842 -0.017472 0.21445 -0.031252 0.31449 0.081611 0.39607 -0.19168 -0.017472 0.23039 0.12696 0.31449 0.43693 -0.0448110.15842 -0.017472 0.479 0.12696 0.31449 -0.017472 -0.14036 0.12696 -0.076317 -0.10466 -0.033752 0.15842 -0.017472 0.23039 -0.21206 0.23039 -0.031252 -0.076317 0.43693 -0.033752 0.15852 0.23039 -0.076317 0.43693 -0.033752 0.35551 0.23039 -0.076317 0.43693 -0.033752 0.15852 0.15842 -0.017472 0.15842 -0.017472

另外,请注意,因为CustAge第一个观测值的预测因子是,对应分数输出是也。

解决方案:要解决此问题,请使用formatpoints函数的名称-值对参数失踪.当使用失踪,你可以替换一个预测器根据三个可供选择的准则(“ZeroWoe”“MinPoints”,或“MaxPoints”).

例如,使用失踪方法替换缺失的值“MinPoints”选择。缺少数据的行现在有一个分数,对应于为其分配可能的最低分数CustAge

Sc = formatpoints(Sc,“失踪”“MinPoints”);[Scores,Points] = score(sc,newdata) PointsTable = displaypoints(sc);: PointsTable (1:7)
Scores = 0.7074 1.4646 0.7662 1.5779 1.4535 1.8944 -0.0872 0.9207 1.0399 0.8252 Points = CustAge ResStatus EmpStatus CustIncome TmWBank OtherCC AMBalance ________ _________ _________ __________ _________ ________ _________ -0.15894 -0.031252 -0.076317 0.43693 0.39607 0.15842 -0.017472 0.43693 -0.033752 0.15842 -0.017472 0.21445 -0.031252 0.31449 0.081611 0.39607 -0.19168 -0.017472 0.23039 0.12696 0.33693 -0.044811 0.15842 0.35551 0.379 0.12696 0.31449 0.43693-0.044811 0.15842 -0.017472 0.479 0.12696 0.31449 0.43693 0.39607 0.15842 -0.017472 -0.14036 -0.076317 0.15842 -0.017472 0.230168 -0.21206 0.23039 -0.033752 -0.076317 0.43693 -0.033752 0.15551 0.23039 0.12696 -0.076317 0.43693 -0.033752 0.15894 'CustAge' '[33, 33)' -0.14036 'CustAge' '[37,40)' -0.060323 'CustAge' ''[40,46)' 0.046408 'CustAge' '[46,48)' 0.21445 'CustAge' '[48,58)' 0.23039 'CustAge' '[58,Inf]' 0.479

注意分数输出有一个第一个客户记录的值,因为CustAge现在有一个值,可以为第一个客户记录计算分数。

另请参阅

||||||||||||||

相关的例子

更多关于