KS
2017-09-07 本文已影响0人
风控_平衡的艺术
KS计算步骤:
1. 数据准备:label,score
2. 排序:score降序排列
3. 计算
累计好 = sum(case when label = 0 then 1 else 0 end)
累计坏 = sum(case when label = 1 then 1 else 0 end)
4. 分别计算累计好占比和累计坏占比
5. 累计好占比和累计坏占比做差,即为KS,求出最大KS

KS计算步骤:
1. 数据准备:label,score
2. 排序:score降序排列
3. 计算
累计好 = sum(case when label = 0 then 1 else 0 end)
累计坏 = sum(case when label = 1 then 1 else 0 end)
4. 分别计算累计好占比和累计坏占比
5. 累计好占比和累计坏占比做差,即为KS,求出最大KS