手把手教你用R语言成立信用评分模子(完结篇)— 打分卡转换
当前位置:以往代写 > 其他教程 >手把手教你用R语言成立信用评分模子(完结篇)— 打分卡转换
2019-06-14

手把手教你用R语言成立信用评分模子(完结篇)— 打分卡转换

手把手教你用R语言成立信用评分模子(完结篇)— 打分卡转换

打分卡转换我们在上一部门,我们已经根基完成了建模相关的事情,并用夹杂矩阵验证了模子的预测本领。接下来的步调,就是将Logistic模子转换为尺度打分卡的形式。 
在成立尺度评分卡之前,我们需要选取几个评分卡参数:基本分值、 PDO(比率翻倍的分值)和优劣比。 这里, 我们取600分为基本分值,PDO为20 (每高20分优劣比翻一倍),优劣比取2.5。;可得下式: 620 = q – p * log(2.5)600 = q – p * log(2.5/2)p = 20/log(2)q =600-20*log(2.5)/log(2)
个中总评分为基本分+部门得分。基本分可通过:
base <- q + p*as.numeric(coe[1])
算出为597分。
而第一个变量AccountBalance的第一种分箱评分得分为 :>AccountBalanceSCORE = p*as.numeric(coe[2])*AccountBalancewoe$woe[1]*-1>-17.23854
以此类推, 我们可以获得所有变量取值分箱的得分,具体代码如下。AccountBalance变量:p*as.numeric(coe[2])*AccountBalancewoe$WOE[1]*-1p*as.numeric(coe[2])*AccountBalancewoe$WOE[2]*-1p*as.numeric(coe[2])*AccountBalancewoe$WOE[3]*-1p*as.numeric(coe[2])*AccountBalancewoe$WOE[4]*-1
Duration变量:p*as.numeric(coe[3])*Durationwoe$WOE[1]*-1p*as.numeric(coe[3])*Durationwoe$WOE[2]*-1p*as.numeric(coe[3])*Durationwoe$WOE[3]*-1
PaymentStatusofPreviousCredit变量:p*as.numeric(coe[4])*PaymentStatusofPreviousCreditwoe$WOE[1]*-1p*as.numeric(coe[4])*PaymentStatusofPreviousCreditwoe$WOE[2]*-1p*as.numeric(coe[4])*PaymentStatusofPreviousCreditwoe$WOE[3]*-1p*as.numeric(coe[4])*PaymentStatusofPreviousCreditwoe$WOE[4]*-1p*as.numeric(coe[4])*PaymentStatusofPreviousCreditwoe$WOE[5]*-1
Purpose变量:for(i in 1:10){print(p*as.numeric(coe[5])*Purposewoe$WOE[i])*-1}CreditAmount变量p*as.numeric(coe[6])*CreditAmountwoe$WOE[1]*-1p*as.numeric(coe[6])*CreditAmountwoe$WOE[2]*-1
ValueSavings变量:p*as.numeric(coe[7])*ValueSavingswoe$WOE[1]*-1p*as.numeric(coe[7])*ValueSavingswoe$WOE[2]*-1p*as.numeric(coe[7])*ValueSavingswoe$WOE[3]*-1p*as.numeric(coe[7])*ValueSavingswoe$WOE[4]*-1
Lengthofcurrentemployment变量:p*as.numeric(coe[8])*Lengthofcurrentemploymentwoe$WOE[1]*-1p*as.numeric(coe[8])*Lengthofcurrentemploymentwoe$WOE[2]*-1p*as.numeric(coe[8])*Lengthofcurrentemploymentwoe$WOE[3]*-1p*as.numeric(coe[8])*Lengthofcurrentemploymentwoe$WOE[4]*-1
Agewoe变量:p*as.numeric(coe[9])*Agewoe$WOE[1]*-1p*as.numeric(coe[9])*Agewoe$WOE[2]*-1
ForeignWorker变量:p*as.numeric(coe[10])*ForeignWorkerwoe$WOE[1]*-1p*as.numeric(coe[10])*ForeignWorkerwoe$WOE[2]*-1
最终得出的打分卡功效为:

手把手教你用R语言创立信用评分模型(完结篇)— 打分卡转换

R语言成立信用模子部门完结,接待分享
全部代码请会见我的Github:https://github.com/frankhlchi/R-scorecard 
接待插手本站果真乐趣群贸易智能与数据阐明群乐趣范畴包罗各类让数据发生代价的步伐,实际应用案例分享与接头,阐明东西,ETL东西,数据客栈,数据挖掘东西,报表系统等全方位常识QQ群:81035754

    关键字:

在线提交作业