datanalysis-credit-risk
它能做什么
这个工具可以整理和清洗信用风险数据。它会移除不必要或质量低的信息,为后续分析做好准备,例如构建贷款模型。
适用场景
- ✓当你手里有需要整理的原始客户数据时。
- ✓当你需要找出并删除缺失信息过多的数据时。
- ✓在构建模型之前,筛选出最重要的信息时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/datanalysis-credit-risk/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我清洗并整理信用风险数据,为分析做好准备。”
每周 5 个新技能,1 分钟读完。
工作原理
该工具会加载你的数据并检查其质量,移除缺失信息过多的数据、无关信息,以及随时间变化不大的信息。它会生成一份详细报告,记录所有处理步骤。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Data Cleaning and Variable Screening
Quick Start
# Run the complete data cleaning pipeline
python ".github/skills/datanalysis-credit-risk/scripts/example.py"
Complete Process Description
The data cleaning pipeline consists of the following 11 steps, each executed independently without deleting the original data:
- Get Data - Load and format raw data
- Organization Sample Analysis - Statistics of sample count and bad sample rate for each organization
- Separate OOS Data - Separate out-of-sample (OOS) samples from modeling samples
- Filter Abnormal Months - Remove months with insufficient bad sample count or total sample count
- Calculate Missing Rate - Calculate overall and organization-level missing rates for each feature
- Drop High Missing Rate Features - Remove features with overall missing rate exceeding threshold
- Drop Low IV Features - Remove features with overall IV too low or IV too low in too many organizations
- Drop High PSI Features - Remove features with unstable PSI
- Null Importance Denoising - Remove noise features using label permutation method
- Drop High Correlation Features - Remove high correlation features based on original gain
- Export Report - Generate Excel report containing details and statistics of all steps
Core Functions
| Function | Purpose | Module |
|---|---|---|
get_dataset() |
Load and format data | references.func |
org_analysis() |
Organization sample analysis | references.func |
missing_check() |
Calculate missing rate | references.func |
drop_abnormal_ym() |
Filter abnormal months | references.analysis |
drop_highmiss_features() |
Drop high missing rate features | references.analysis |
drop_lowiv_features() |
Drop low IV features | references.analysis |
drop_highpsi_features() |
Drop high PSI features | references.analysis |
drop_highnoise_features() |
Null Importance denoising | references.analysis |
drop_highcorr_features() |
Drop high correlation features | references.analysis |
iv_distribution_by_org() |
IV distribution statistics | references.analysis |
psi_distribution_by_org() |
PSI distribution statistics | references.analysis |
value_ratio_distribution_by_org() |
Value ratio distribution statistics | references.analysis |
export_cleaning_report() |
Export cleaning report | references.analysis |
Parameter Description
Data Loading Parameters
DATA_PATH: Data file path (best are parquet format)DATE_COL: Date column nameY_COL: Label column nameORG_COL: Organization column nameKEY_COLS: Primary key column name list
OOS Organization Configuration
OOS_ORGS: Out-of-sample organization list
Abnormal Month Filtering Parameters
min_ym_bad_sample: Minimum bad sample count per month (default 10)min_ym_sample: Minimum total sample count per month (default 500)
Missing Rate Parameters
missing_ratio: Overall missing rate threshold (default 0.6)
IV Parameters
overall_iv_threshold: Overall IV threshold (default 0.1)org_iv_threshold: Single organization IV threshold (default 0.1)max_org_threshold: Maximum tolerated low IV organization count (default 2)
PSI Parameters
psi_threshold: PSI threshold (default 0.1)max_months_ratio: Maximum unstable month ratio (default 1/3)max_orgs: Maximum unstable organization count (default 6)
Null Importance Parameters
n_estimators: Number of trees (default 100)max_depth: Maximum tree depth (default 5)gain_threshold: Gain difference threshold (default 50)
High Correlation Parameters
max_corr: Correlation threshold (default 0.9)top_n_keep: Keep top N features by original gain ranking (default 20)
Output Report
The generated Excel report contains the following sheets:
- 汇总 - Summary information of all steps, including operation results and conditions
- 机构样本统计 - Sample count and bad sample rate for each organization
- 分离OOS数据 - OOS sample and modeling sample counts
- Step4-异常月份处理 - Abnormal months that were removed
- 缺失率明细 - Overall and organization-level missing rates for each feature
- Step5-有值率分布统计 - Distribution of features in different value ratio ranges
- Step6-高缺失率处理 - High missing rate features that were removed
- Step7-IV明细 - IV values of each feature in each organization and overall
…
常见问题
什么是“信用风险数据”?
这是关于客户的信息,用于预测客户无法按时还款的可能性。
IV 和 PSI 是什么?
IV(信息价值,Information Value)和 PSI(群体稳定性指数,Population Stability Index)是用来评估数据信息质量和稳定性的指标。
这个工具会删除我的原始数据吗?
不会。该工具在处理数据时不会删除原始文件,确保你始终保留最初的文件。
详情
作者的原始描述
Credit risk data cleaning and variable screening pipeline for pre-loan modeling. Use when working with raw credit data that needs quality assessment, missing value analysis, or variable selection before modeling. it covers data loading and formatting, abnormal period filtering, missing rate calculation, high-missing variable removal,low-IV variable filtering, high-PSI variable removal, Null Impor
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7162
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。