🤖 AI 智能建模
内置风控建模 Skill,AI 助手自动引导完成 10 步建模全流程,确保模型质量
from yihuier import Yihuier
# 初始化
yh = Yihuier(data, target='dlq_flag')
# 数据预处理
yh.data = yh.dp_module.delete_missing_var(threshold=0.2)
# 变量分箱
bin_df, iv_value = yh.binning_module.binning_num(
col_list=['v1', 'v2', 'v3'],
max_bin=5,
method='ChiMerge'
)
# WOE 转换
data_woe = yh.binning_module.woe_transform()
# 变量选择
xg_imp, _, xg_cols = yh.var_select_module.select_xgboost(
col_list=data_woe.drop(['dlq_flag'], axis=1).columns.tolist(),
imp_num=10
)与其他工具对比
| 特性 | Yihuier | Scorecardpy | Toad |
|---|---|---|---|
| 分箱方法 | 4种 | 2种 | 3种 |
| WOE 转换 | ✅ | ✅ | ✅ |
| 变量选择 | 3种策略 | 1种 | 2种 |
| 模型评估 | 完整 | 基础 | 完整 |
| 评分卡实现 | 完整 | 部分 | 部分 |
| 模型监控 | ✅ | ❌ | ❌ |
| Python 版本 | 3.13+ | 3.6+ | 3.6+ |
| 类型提示 | 完整 | 无 | 无 |
| 中文文档 | ✅ | ❌ | 部分 |
本项目采用 MIT 许可证发布。
感谢开源社区的所有贡献者!
GitHub: encyc/yihuier
PyPI: yihuier