liveBook · Manning

Tree-based model

As explained in Fight Fraud with Machine Learning

A tree-based model is a predictive model whose decision process is represented by one or more tree structures with conditional feature-based splits.

A tree-based method predicts by applying conditional rules to feature values. A decision tree organizes those rules hierarchically; ensemble methods combine many trees. In fraud detection, tree-based models are a classical ML choice for learning patterns in online-transaction data rather than maintaining growing collections of hand-written rules. section 3.0 section 3.4

Tree-based methods fit tabular fraud data especially well when features are categorical. They can split on categorical values without explicit encoding or transformation, and they usually do not require feature scaling because decisions use relative values and thresholds rather than feature magnitude. section 3.4 section 3.9

A practical fraud-model workflow is:

  • Clean and inspect the dataset, including fraud-label distribution, feature relationships, and class imbalance. section 3.9
  • Split training and test data; for time-ordered data, reserve the latest 20% as the test set. section 3.9
  • Train and tune a decision tree or random forest using cross-validation and random hyperparameter search; class weights can compensate for rare fraud cases. section 3.4 section 3.9
  • Compare models with AUPRC on class-imbalanced data, then interpret the selected model with feature importance or individual trees. section 3.4 section 3.9

Online-transaction fraud detection

Train a random forest on selected transaction features. Each tree learns from different data subsets and feature samples, and the forest combines their decisions. A gradient boosted tree instead trains trees sequentially to reduce prior errors; it often performs better for fraud tasks, although results depend on the dataset and task. section 3.4 section 3.9

Figure 3.11 Steps in building a decision-tree-based online transactions fraud detection model.

Follow the end-to-end decision-tree workflow from train/test splitting through model training and evaluation for online-transaction fraud. section 3.4

How Fight Fraud with Machine Learning covers it

How deep it goes
Explains decision trees and random forests through training, tuning, AUPRC evaluation, and interpretation; defers detailed model discussion to appendices.
Examples
Uses a cleaned online-transactions dataset, categorical features, cross-validation, random hyperparameter search, and a random-forest fraud model.
What it assumes
Assumes a processed dataset and selected features while teaching the training, evaluation, and interpretation workflow.
What you can do after
Build it from scratch as a tuned and interpreted tree-based fraud detector evaluated on held-out transaction data.
How it connects
Connects decision trees, random forests, gradient boosted trees, feature engineering, class imbalance, AUPRC, and feature importance.

Also explained in

Compare how 4 books explain tree-based model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fight Fraud with Machine Learning. The section links point to the parts of the book it draws on.