变量分箱(woebin, woebin_plot, woebin_adj, woebin_ply) 分数转换(scorecard, scorecard_ply) 效果评估(perf_eva, perf_psi) scorecardpy安装 pip install scorecardpy 基本流程 数据准备 import scorecardpy as sc dat = sc.germancredit() ## 变量筛选 dt_s = sc.var_filter(dat, y="creditability")...
数据集划分 (split_df)变量筛选(iv, var_filter)变量分箱(woebin, woebin_plot, woebin_adj, woebin_ply)分数转换(scorecard, scorecard_ply)效果评估(perf_eva, perf_psi)基于github主页上提供的案例,对每一步操作进行详细解读:数据准备 import scorecardpy as sc # 加载德国信用卡相关数据集 dat = sc....
train,test=sc.split_df(dt_s,'creditability').values() # woe binning --- bins=sc.woebin(dt_s,y="creditability") # sc.woebin_plot(bins) # binning adjustment # # adjust breaks interactively # breaks_adj = sc.woebin_adj(dt_s, "creditability", bins) # # or specify breaks manually ...
train_woe=sc.woebin_ply(train[cols], bins_adj) test_woe=sc.woebin_ply(test[cols], bins_adj) train_woe.columns'''Index(['creditability', 'credit.history_woe', 'purpose_woe', 'other.debtors.or.guarantors_woe', 'duration.in.month_woe', 'present.employment.since_woe', 'savings.accoun...
例如,`sc.woebin_plot`可以绘制WOE和IV的图表,`sc.perf_plot`可以绘制模型评估指标的曲线图。 除了上述的基本功能,ScorecardPy还支持一些高级功能,例如特征交互、多项式特征和变量筛选等。用户可以根据具体需求选择合适的功能来构建信用评分卡模型。 使用ScorecardPy构建信用评分卡模型的一般流程如下: 1.数据准备:包括...
证据权重 (woe) 分箱(woebin、woebin_plot、woebin_adj、woebin_ply) 评分卡缩放 (scorecard, scorecard_ply) 性能评估(perf_eva、perf_psi) Github:https://github.com/shichenxie/scorecardpy 案例 scorecardpy库的使用简介 - 知乎 评分卡建模工具scorecardpy全解读 - 知乎 ...
bins = sc.woebin(dt_s, y="creditability") # sc.woebin_plot(bins) # binning adjustment # # adjust breaks interactively # breaks_adj = sc.woebin_adj(dt_s, "creditability", bins) # # or specify breaks manually breaks_adj = {
sc.woebin_plot(bins) ''' 运行最后一行命令时会出现错误提示如下: C:\ProgramData\Anaconda3\lib\site-packages\scorecardpy\woebin.py:1203: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly ...
woebin(dt_s, y="creditability") # sc.woebin_plot(bins) # binning adjustment # # adjust breaks interactively # breaks_adj = sc.woebin_adj(dt_s, "creditability", bins) # # or specify breaks manually breaks_adj = { 'age.in.years': [26, 35, 40], 'other.debtors.or.guarantors':...
决策树分箱(woebin, woebin_plot, woebin_adj, woebin_ply) 评分转换(scorecard, scorecard_ply) 模型评估(perf_eva, perf_psi) 二,数据背景 数据集包含1000个条目,其中包含Hofmann教授准备的20个分类/符号属性。在此数据集中,每个条目都表示一个从银行获得信贷的人。根据属性集,每个人都被归类为良好或不良的...