mcpbeat Sign in

Datanalysis Credit Risk Agent Skill

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.

22k tokens
context cost
the whole folder, loaded on every use
4
files
ships runnable scripts
1
copies elsewhere
how many repositories repackaged it
37394
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/github/awesome-copilot --skill datanalysis-credit-risk

What comes with it

80 303 bytes besides the instruction
references/analysis.py
references/func.py
scripts/example.py

The instruction itself

15 sections, as written by the author

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

10. Drop High Correlation Features - Remove high correlation features based on original gain

11. 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 name
  • Y_COL: Label column name
  • ORG_COL: Organization column name
  • KEY_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

10. Step7-IV分布统计 - Distribution of features in different IV ranges

11. Step8-PSI明细 - PSI values of each feature in each organization each month

12. Step8-PSI处理 - Features that do not meet PSI conditions and unstable organizations

13. Step8-PSI分布统计 - Distribution of features in different PSI ranges

14. Step9-null importance处理 - Noise features that were removed

15. 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

Other skills for the same job

different authors, same section of the catalogue
XLSX
by anthropics
vendor ×15

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

5k tokens scripts
XLSX
by w95
×7

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

3k tokens
Raffle Winner Picker
by frostant
×5

Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.

949 tokens
Fda Database
by christophacham
×4

Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.

32k tokens scripts
Matlab
by christophacham
×4

MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.

25k tokens
Umap Learn
by ComeOnOliver
×4

UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.

14k tokens
D3 Viz
by chrisvoncsefalvay
×3

Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.

20k tokens
Alphafold Database
by christophacham
×3

Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.

7k tokens

How to use it

Copy the folder

Take github/datanalysis-credit-risk from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.