Чтобы создать объект compactCreditScorecard
, сначала создайте объект creditscorecard
с помощью файла CreditCardData.mat
, чтобы загрузить data
(использующий набор данных от Refaat 2011).
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: [1200×11 table]
Прежде, чем создать объект compactCreditScorecard
, необходимо использовать autobinning
и fitmodel
с объектом creditscorecard
.
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:
status ~ [Linear formula with 8 terms in 7 predictors]
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
Используйте объект creditscorecard
с compactCreditScorecard
, чтобы создать объект compactCreditScorecard
.
csc =
compactCreditScorecard with properties:
Description: ''
NumericPredictors: {'CustAge' 'CustIncome' 'TmWBank' 'AMBalance'}
CategoricalPredictors: {'ResStatus' 'EmpStatus' 'OtherCC'}
PredictorVars: {'CustAge' 'ResStatus' 'EmpStatus' 'CustIncome' 'TmWBank' 'OtherCC' 'AMBalance'}
Затем используйте score
с объектом compactCreditScorecard
. В целях рисунка предположите, что несколько строк от исходных данных являются нашими "новыми" данными. Используйте входной параметр data
в функции score
, чтобы получить музыку к newdata
.
Scores = 11×1
0.8252
0.6553
1.2443
0.9478
0.5690
1.6192
0.4899
0.3824
0.2945
1.4401
⋮
Points=11×7 table
CustAge ResStatus EmpStatus CustIncome TmWBank OtherCC AMBalance
_________ _________ _________ __________ _________ ________ _________
0.23039 0.12696 -0.076317 0.43693 -0.033752 0.15842 -0.017472
0.23039 -0.031252 -0.076317 0.052329 -0.033752 0.15842 0.35551
0.23039 0.37641 -0.076317 0.24473 -0.044811 0.15842 0.35551
0.479 0.12696 -0.076317 0.43693 -0.18257 -0.19168 0.35551
0.046408 0.37641 -0.076317 0.092433 -0.033752 -0.19168 0.35551
0.21445 0.37641 0.31449 0.24473 -0.044811 0.15842 0.35551
-0.14036 0.12696 0.31449 0.081611 -0.033752 0.15842 -0.017472
-0.060323 -0.031252 0.31449 0.052329 -0.033752 0.15842 -0.017472
-0.15894 0.12696 0.31449 -0.45716 -0.044811 0.15842 0.35551
0.23039 0.12696 0.31449 0.43693 -0.18257 0.15842 0.35551
0.23039 0.37641 -0.076317 0.24473 -0.044811 0.15842 -0.064636