datanalysis-credit-risk
Cleans and prepares credit risk data for modeling. It removes bad data and irrelevant variables. It's useful before building loan models.
What it does
This tool organizes and cleans credit risk data. It removes unnecessary or low-quality information to prepare the data for future analyses, such as building loan models.
When to use it
- ✓When you have raw customer data that needs organizing.
- ✓If you need to identify and remove data with too much missing information.
- ✓To select the most important information before building a model.
Example of what to ask your AI
“Clean and prepare my credit risk data for analysis.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool loads your data and checks its quality, removing data with too much missing information, irrelevant information, or information that doesn't change much over time. It generates a detailed report of everything that was done.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill datanalysis-credit-riskOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/datanalysis-credit-risk/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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
…
FAQ
What is 'credit risk data'?
It is information about customers that helps predict the likelihood of them not repaying a loan.
What are 'IV' and 'PSI'?
IV (Information Value) and PSI (Population Stability Index) are metrics used to assess the quality and stability of information in the data.
Does the tool delete my original data?
No, the tool works with the data without deleting the originals, ensuring you always have the initial file.
Details
Original description by the author
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
Popularity
- GitHub stars
- 40k
- Ranking position
- #5105
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
pytorch-patterns
Helps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
affaan-m/ECC
evm-token-decimals
Helps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
affaan-m/ECC
knowledge-agent
Creates and queries knowledge bases using AI. It allows asking questions about past work or compiling expertise on a topic.
thedotmack/claude-mem