AI guide
【One-Line Pitch】
A practitioner-oriented guide to building machine-learning risk-control systems for consumer credit, showing how to turn messy lending data into fraud and default predictions that survive real deployment. Best for analysts, modelers, and engineers who already know basic credit scorecards and want the advanced, code-heavy playbook.
【Book Arc】
- **Opening (~0%–10%)**: Frames why finance leans on Python and traces risk management from pure human judgment to "human + computer" to today's intelligent stage; introduces the four defining traits of risk-control ML (rare negatives, high explainability demands, diverse models, rich data) and the end-to-end industrial modeling workflow.
- **Early (~10%–30%)**: Covers credit fundamentals, label definition, sampling, observation/performance windows, and the develop/validation/out-of-time split; then builds rule engines by combining feature engineering with CART regression trees to auto-mine segmentation rules.
- **Early–Middle (~30%–45%)**: Moves into ensemble scorecards with XGBoost, contrasting complex-feature-plus-simple-algorithm against simple-feature-plus-complex-algorithm, and details credit feature families (personal, financial, multi-lending, consumption, platform history, app tracking, external credit bureau).
- **Middle (~45%–60%)**: Dives into feature engineering mechanics — time-window aggregations, trend/volatility features — and categorical encoding via one-hot versus WOE, including automated WOE binning that maximizes negative-rate separation.
- **Late (~60%–85%)**: Addresses transfer learning for project cold start, survivor bias and imbalanced learning through unsupervised and semi-supervised methods, and unsupervised anomaly detection for data cleaning and individual fraud detection.
- **Ending (~85%–100%)**: Shares proven model-optimization and model-fusion strategies, then closes with knowledge-graph and complex-network basics plus network representation learning, where community detection supports gang-fraud detection and credit-model improvement.
【Key Takeaways】
- **Risk-control ML is defined by its constraints, not its algorithms** (Opening): rare negatives, explainability pressure, and business-specific models shape every design choice, so generic ML recipes rarely transfer directly.
- **Label definition is a modeling decision, not a given** (Early): using a 15-day overdue threshold and dropping ambiguous "gray samples" makes the binary distribution cleaner and the model easier to learn.
- **Sampling must be paired with weighting** (Early): undersampling positives without re-adding weights distorts validation metrics and expected loss, so weights must flow through evaluation.
- **Rules and models solve different problems** (Early): rule mining via decision trees delivers fast, interpretable segmentation, while ML models suit precision-critical cases — mature teams use both.
- **Feature engineering dominates outcomes** (Middle): time-window aggregation, trend, and volatility features around repayment ability and willingness matter more than tuning, and WOE encoding beats one-hot for short categorical variables.
- **Imbalance and cold start are first-class problems** (Late): transfer learning, semi-supervised, and unsupervised anomaly methods are the practical answers when labels are scarce or a new product has no history.
- **Fraud detection is not binary** (Late): because fraud tactics vary, it behaves more like multi-class or anomaly detection, and graph/community methods are needed for organized fraud rings.
- **Model fusion and optimization yield incremental, not transformative, gains** (Ending): better variables and model selection beat parameter tuning, and complex models are often best used as feature generators feeding simpler scorecards.
【Reading Tips】
- Deep-read Chapters 1–2 if you are new to credit modeling; the workflow, label, and sampling logic underpins everything later.
- Skim the long code blocks on first pass — extract the design pattern (aggregation function, binning rule) rather than memorizing syntax.
- Treat the WOE binning and decision-tree rule-mining sections as templates you can adapt to your own data.
- For the later chapters on transfer learning, anomaly detection, and graph methods, focus on when to apply each technique rather than full implementation detail.
- Keep the business framing in view: every algorithm here exists to serve a lending decision, so ask "what decision does this improve?"
【Coverage Limits】
This guide is synthesized from stratified excerpts covering roughly the first half of the book in detail, with later chapters (transfer learning, imbalance handling, anomaly detection, model fusion, knowledge graphs) represented mainly by chapter-level summaries; specific case results and full code in those later chapters are not covered.
Passage locations
Excerpt 1
日之功,而需要坚定自己的理想与信念,持之以恒地付出与努力。 第三部曲是“众里寻他千百度,蓦然回首,那人却在灯火阑珊处”。(辛弃疾《青玉案·元夕》)虽然包括机器学习在内的人工智能技术很强大,但是它所能发挥的作用大小与运用场景密不可分,在大量的运用场景中,风险管理可以说是最佳的运用场景之一。广大读者在学习本书时需要结...
View in text
Excerpt 2
会带来更大的收益。实践中,通常会针对数据挑选接受度更高的模型,并引入通过模型自动组合特征的机制。这有助于数据信息的挖掘。而多模型的融合机制可以极大地降低模型的方差(Variance),这有助于增强模型的泛化能力。模型优化的主要内容在第7章进行介绍。 本书将尽量避免使用表现较差的网格搜索(Grid Search)等...
View in text
Excerpt 3
生成中的一般应用。在数据源确定的情况下,从下一章开始,正式介绍风控领域的一些典型问题,以及机器学习模型在其中的应用。 第2章 集成模型评分卡 第 2 章 集 成 模 型 评 分 卡 本章主要介绍如何通过极端梯度提升机(eXtreme Gradient Boosting,XGBoost)模型生成评分卡;同时会对建模...
View in text
Excerpt 4
for col in self.vars: 23. # 得到与每一个特征值对应的样本数 24. data = dict(self.devf[[col, self.dep]].groupby( 25. [col, se...
View in text