datanalysis-credit-risk
- Use it when:
- You're preparing raw credit data for a pre-loan risk model and need to choose which variables are worth keeping.
- It does:
- Runs a bundled Python script through 11 steps, from per-organization bad rates to missing-rate, IV, PSI, noise and correlation screens.
- You get:
- One Excel report, its file and sheet names in Chinese, with a sheet per step listing each month or feature flagged for removal and why; your data is only read.
- Expects:
- Feature columns whose names start with i_, plus the date, label, organization and key columns you name.
- Asks you:
- At the terminal for paths, column names, out-of-sample organizations and every threshold, each with a default.
- Needs:
- Python with pandas, toad, LightGBM, scikit-learn, joblib and openpyxl, which the script imports but the SKILL.md doesn't list.
Needs Python with pandas, numpy, toad, LightGBM, scikit-learn, openpyxl, joblib and tqdm. Its script asks for every path, column and threshold at the terminal, and names the Excel report and its sheets in Chinese.
TL;DR
Credit-risk models start from wide tables of candidate variables, many too sparse, weak or unstable to keep. This skill runs a bundled Python script through that screening. It loads a parquet, CSV, Excel or pickle file, treats -1, -999 and -1111 as missing, and counts samples and bad rates per organization, the column naming each sample's source institution. It sets aside the out-of-sample organizations you name and flags months with too few bad or total samples. Then, for every feature, it computes missing rates overall and per organization and flags those over a missing-rate threshold (default 0.6); with low information value (IV, how well a feature separates good from bad borrowers); with an unstable population stability index (PSI, how much its distribution drifts month to month); that look like noise under Null Importance, which compares LightGBM gain on real and shuffled labels; and, among highly correlated features, those with lower gain. Each step runs on its own copy of the data rather than on the previous step's result, so the screens can be compared. IV and PSI calculations run in parallel across CPU cores, and the report, 数据清洗报告.xlsx, goes to the output folder you name.
Summarizes the skill at 797337f.
npx skills add https://github.com/github/awesome-copilot --skill datanalysis-credit-risk skills.sh pageSource on GitHubAll skills from github/awesome-copilot
- Total Downloads
- 7,300 on skills.sh, Nov 9, 2026
- Repo stars
- 40,943 github/awesome-copilot
- First seen
- Mar 2, 2026 on skills.sh
Weekly values
| Week to | Installs |
|---|---|
| Sep 21 | 12 |
| Sep 28 | 12 |
| Oct 5 | 12 |
| Oct 12 | 3 |
| Oct 19 | 1 |
| Oct 26 | 0 |
| Nov 2 | 6 |
| Nov 9 | 2 |
| Category |
Research reproduction, financial data, charts and diagrams. |
|---|---|
| Type |
Operates a CLI, API, app or bundled script to get something done. |
| Effect |
Its own steps create or change files, git state or local tools. |
| Needs |
A specific command-line tool or desktop app must be installed, such as gh, agent-browser, LibreOffice, Obsidian or a vendor CLI. |
| Publisher |
A verified publisher on skills.sh, or the company or maintainer behind the product the skill operates. |
| Topics | |
| Stack |
SKILL.md
From github/awesome-copilot at 797337f. Checked daily, last changed Nov 6, 2026.
Frontmatter
name: datanalysis-credit-risk
description: 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 Importance denoising, high-correlation variable removal, and cleaning report generation. Applicable scenarios arecredit risk data cleaning, variable screening, pre-loan modeling preprocessing.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
- Step7-IV处理 - Features that do not meet IV conditions and low IV organizations
- Step7-IV分布统计 - Distribution of features in different IV ranges
- Step8-PSI明细 - PSI values of each feature in each organization each month
- Step8-PSI处理 - Features that do not meet PSI conditions and unstable organizations
- Step8-PSI分布统计 - Distribution of features in different PSI ranges
- Step9-null importance处理 - Noise features that were removed
- Step10-高相关性剔除 - High correlation features that were removed
Features
- Interactive Input: Parameters can be input before each step execution, with default values supported
- Independent Execution: Each step is executed independently without deleting original data, facilitating comparative analysis
- Complete Report: Generate complete Excel report containing details, statistics, and distributions
- Multi-process Support: IV and PSI calculations support multi-process acceleration
- Organization-level Analysis: Support organization-level statistics and modeling/OOS distinction