xgb-deepmodel

Train segmented XGBoost sub-models and fuse them via out-of-fold stacking.

580|66|Updated Apr 21, 2025
One-click install
npx skills add https://github.com/aliyun/qwen-dianjin --skill xgb-deepmodel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xgb-deepmodel
Source: https://github.com/aliyun/qwen-dianjin/tree/main/DianJin-SKILLS/financial-engineering-expert/xgb-deepmodel
Command: npx skills add https://github.com/aliyun/qwen-dianjin --skill xgb-deepmodel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires json, numpy, pandas, xgboost, scikit-learn, and includes scripts (resource) components.

What problem does it solve?

This Skill addresses how to improve financial modeling performance when different customer segments behave differently, by training separate XGBoost sub-models per segment and then fusing them via Stacking to reduce global bias and better capture segment-specific patterns.

Core Features & Use Cases

  • Segmented XGBoost sub-model training: Train multiple XGBoost models using mutually exclusive segment conditions, with optional per-segment feature sets and positive class weighting.
  • OOF Stacking fusion: Generate out-of-fold (OOF) predictions from each sub-model and train a meta-learner (conservative parameters) to combine them safely.
  • Ensemble vs baseline comparison report: Compare the best sub-model vs Stacking ensemble against an XGBoost single-model baseline using Train/Val/OOT AUC/KS and gap-based decision guidance.
  • Use cases: segment modeling, customer stratification, sub-model fusion, and advanced ensemble learning scenarios (e.g., banking/insurance/securities risk scoring).

Quick Start

Train segment sub-models, fuse them with stacking, and generate an ensemble vs baseline comparison report for your labeled dataset using the three scripts in order: sub_trainer → stacker → comparator.

Frequently Asked Questions about xgb-deepmodel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train separate XGBoost models for different customer segments and combine them?

You can train separate XGBoost sub-models for mutually exclusive customer segments and fuse them via out-of-fold Stacking to reduce global bias and capture segment-specific patterns effectively.

What is out-of-fold Stacking for segmented modeling?

Out-of-fold Stacking generates OOF predictions from each segment-specific XGBoost sub-model and trains a meta-learner with conservative parameters to safely combine them into a single ensemble model.

Can I apply per-segment feature selection and positive class weighting in XGBoost?

Yes, you can define optional per-segment feature sets and positive class weighting configurations via a JSON config to customize the XGBoost sub-model training for each user-defined segment.

How do I evaluate ensemble vs baseline XGBoost models using AUC, KS, and OOT data?

The comparator generates an evaluation report comparing the best sub-model and Stacking ensemble against an XGBoost single-model baseline using Train, Validation, and OOT AUC and KS metrics.

Does this segmented XGBoost workflow enforce validation for early stopping and OOT for final comparison?

Yes, the three-stage workflow strictly enforces using the validation set for XGBoost early stopping and reserves the OOT dataset exclusively for final ensemble versus baseline model comparison.

When should I use segmented sub-model fusion instead of a single XGBoost model for risk scoring?

Segmented sub-model fusion is ideal for banking, insurance, or securities financial risk scoring when distinct customer segments exhibit different behaviors that a single global model cannot capture.