Decision tree
A decision tree is a tree-structured model or representation in which successive tests or choices lead through branches to outcomes, predictions, or actions.
Grokking Machine Learning
An algorithm that recursively splits labeled data using feature tests and stopping conditions to construct a decision tree.
- How it is used
- Uses labeled features to predict classes or values, including app recommendations and user engagement.
- How deep it goes
- Works through recursive classification splits, impurity comparisons, geometric boundaries, and regression cutoffs, then fits trees with Scikit-Learn.
- Examples
- Uses jacket decisions, app downloads, plotted classification boundaries, age-based engagement, and fraud-detection and health exercises.
- What you can do after
- Build it from scratch by choosing and repeating feature splits, or apply it via Scikit-Learn to classification and regression data.
Statistics Every Programmer Needs
A decision tree is a graphical decision-analysis model that represents choices, uncertain events, possible outcomes, probabilities, and payoffs as branching paths.
- How it is used
- Maps choices, uncertain events, and payoffs to compare actions by expected value.
- How deep it goes
- Works through schema construction, probability checks, backward expected-payoff calculations, and plotting rather than predictive-model training.
- Examples
- Compares baseball contract offers using health, performance incentives, agent fees, branch probabilities, and plotted payoffs.
- What you can do after
- Build it from scratch by specifying branches and payoffs, calculating expected values, and plotting the result with Python.
Read how Statistics Every Programmer Needs explains decision tree →
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
A decision tree is a predictive model that recursively partitions inputs using feature-based split rules and produces outcomes at terminal leaves.
- How it is used
- Uses feature-based rules to make explainable predictions for tabular classification and regression problems.
- How deep it goes
- Explains roots, branches, leaves, split criteria, complexity controls, and ensemble roles without deriving impurity formulas.
- Examples
- Uses animal classification, Airbnb price classification, nonlinear-function approximation, and extracted XGBoost or LightGBM tree paths.
- What you can do after
- Apply it via scikit-learn pipelines, cross-validation, and depth or sample-size controls for tabular classification.
Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains decision tree →
Ensemble Methods for Machine Learning
A decision tree is a predictive model that recursively partitions data according to feature-based decisions, producing predictions at the resulting leaves.
- How it is used
- Models supervised classification and regression while illustrating fit, complexity, and interpretability tradeoffs.
- How deep it goes
- Explains nodes, leaves, depth, nonlinear growth, evaluation curves, and rule interpretation without deriving split optimization.
- Examples
- Uses Friedman-1 regression, a noisy nonlinear function, and Iris species classification with visualized rules.
- What you can do after
- Apply it via scikit-learn to train bounded-depth regressors or classifiers, evaluate held-out performance, and inspect learned rules.
Read how Ensemble Methods for Machine Learning explains decision tree →
Timeless Algorithms, The Foundational Ideas
A decision tree is a hierarchical predictive model that recursively partitions data using feature-based rules.
- How it is used
- Uses recursive partitions to predict categorical or numerical outcomes and motivate more stable ensembles.
- How deep it goes
- Explains split selection, leaf predictions, greedy instability, depth and overfitting, and ensemble remedies.
- Examples
- Illustrates classification with loan approval and regression with house-price prediction.
- What you can do after
- Evaluate/understand how splits produce predictions and why a well-fitting tree may generalize poorly.
Read how Timeless Algorithms, The Foundational Ideas explains decision tree →
Grokking Machine Learning, Second Edition
A procedure for constructing a decision tree by recursively selecting feature-based splits subject to stopping conditions and assigning predictions to terminal nodes.
- How it is used
- Uses labeled data to make classification or regression predictions through feature-based questions.
- How deep it goes
- Works through recursive training, prediction traversal, split metrics, geometric boundaries, and Scikit-Learn implementations.
- Examples
- Uses jacket choices, app recommendations, geometric labels, university admissions, user engagement, spam, fraud, and COVID-19 symptoms.
- What you can do after
- Apply it via Scikit-Learn to train classifiers or regressors and make predictions from separated features and labels.
Read how Grokking Machine Learning, Second Edition explains decision tree →
Statistics Slam Dunk
A decision tree is a predictive model that recursively partitions data using feature-based decision rules.
- How it is used
- Uses decision tree regression to isolate hustle statistics associated with regular-season wins.
- How deep it goes
- Explains predictor splits, terminal nodes, residual error, fitting, and visualization without detailing the tree-building algorithm.
- Examples
- Models NBA regular-season wins from screen points, deflections, loose balls, and contested-shot statistics.
- What you can do after
- Apply it via R's tree() function to fit and visualize continuous-outcome prediction rules.
Outlier Detection in Python
A decision tree is a hierarchical predictive model that recursively partitions observations using feature-based decision rules.
- How it is used
- Uses trees to flag real records resembling synthetic ones and to provide interpretable approximations of outlier-detector predictions.
- How deep it goes
- Works through synthetic-data classification and proxy fitting with evaluation, but does not derive tree-splitting internals.
- Examples
- Uses breast-cancer records for real-versus-fake classification and feature-threshold rules for an Isolation Forest proxy.
- What you can do after
- Apply it via scikit-learn to identify real-versus-synthetic outlier candidates or approximate a detector’s scores and binary labels.
Read how Outlier Detection in Python explains decision tree →
Grokking AI Algorithms, Second Edition
A decision tree is a predictive model that recursively applies feature-based tests to partition examples and produce a classification or regression outcome.
- How it is used
- Uses decision trees to classify examples by learning relationships between features and categories.
- How deep it goes
- Works through CART split selection, Gini impurity, information gain, recursive construction, and classification testing.
- Examples
- Uses diamond carat and price to predict grouped cut categories, then tests predictions on labeled diamonds.
- What you can do after
- Build a classifier from scratch and evaluate its predictions on labeled test examples.
Read how Grokking AI Algorithms, Second Edition explains decision tree →
Build AI Drug Discovery Pipelines
A decision tree is a hierarchical predictive model that applies feature-based decision rules to reach an output.
- How it is used
- Uses transparent sequential rules to classify molecules for cytochrome P450 inhibition.
- How deep it goes
- Explains nodes, impurity, traversal, predictions, probability estimates, regularization, and pruning.
- Examples
- Demonstrates molecular weight and logP descriptors, a depth-2 classifier, tree visualizations, and five-molecule validation traversal.
- What you can do after
- Build it with RDKit and scikit-learn, visualize decisions, and generate class predictions and probability estimates.
Read how Build AI Drug Discovery Pipelines explains decision tree →
Data Without Labels
A tree-structured predictive model that recursively splits data into nodes using decision rules.
- How it is used
- Frames decision tree as an available algorithm for supervised regression problems.
- How deep it goes
- Defines roots, decision nodes, and terminal nodes, but does not explain split criteria, training, or prediction procedures.
- Examples
- Places decision trees beside a height-to-weight regression problem and a structured telecom churn dataset.
- What you can do after
- Evaluate/understand a decision tree’s basic node-and-split structure and recognize it as a regression option.
Inside AI
A decision tree is a hierarchical predictive model that recursively splits data according to attribute-based questions to reach decisions or predictions.
- How it is used
- Supports classification by mapping labeled input data to categories or decisions through sequential attribute tests.
- How deep it goes
- Explains nodes, branches, leaves, recursive partitioning, and attribute ranking, but does not provide the underlying mathematical formulas.
- Examples
- Uses animal classification and credit-card fraud detection to demonstrate question ordering, branching, and final decisions.
- What you can do after
- Build it from scratch by ranking transaction attributes, recursively partitioning labeled records, and assigning decisions to terminal branches.
Fight Fraud with Machine Learning
A decision tree is a predictive model that recursively partitions instances using feature-based conditions until reaching decision leaves.
- How it is used
- Supports fraud classification on tabular transactions, especially when categorical features contribute to distinguishing fraudulent and genuine activity.
- How deep it goes
- Explains hierarchical rules, thresholds, leaves, majority labels, feature importance, and Gini impurity down to plotted tree nodes.
- Examples
- Uses transaction splits on TRANSFER and amount, plotted tree nodes, feature-importance listings, and fraudulent-versus-genuine leaves.
- What you can do after
- Build it from scratch as a fraud classifier, evaluate it with AUPRC, and inspect its rules and influential features.
Read how Fight Fraud with Machine Learning explains decision tree →
Machine Learning Algorithms in Depth
A decision tree is a hierarchical predictive model that makes decisions by applying feature-based tests at internal nodes.
- How it is used
- Uses supervised classification and regression by recursively partitioning feature space into predictive leaf regions.
- How deep it goes
- Derives feature-threshold selection, impurity objectives, and recursive growth, then implements CART while deferring complete optimization details.
- Examples
- Demonstrates CART with an Iris dataset workflow, accuracy scoring, and a from-scratch node-and-classifier implementation.
- What you can do after
- Build it from scratch by selecting thresholds, minimizing impurity, growing nodes recursively, and evaluating classification predictions.
Read how Machine Learning Algorithms in Depth explains decision tree →
Machine Learning Platform Engineering
A decision tree is a predictive model that recursively partitions input data using feature-based decision rules.
- How it is used
- Deploys a decision tree as a tracked income-classification experiment within a reproducible ML workflow.
- How deep it goes
- Explains implementation through preprocessing, fitting, evaluation, dataset logging, parameter logging, and model persistence.
- Examples
- Demonstrates an income classifier trained on encoded features and compared with random forest and XGBoost models.
- What you can do after
- Build a tracked decision-tree experiment that records datasets, metrics, parameters, and a reloadable model artifact.
Read how Machine Learning Platform Engineering explains decision tree →
Demand Forecasting Best Practices
A decision tree is a machine-learning model that makes predictions by applying a sequence of feature-based questions and following the resulting branches to a terminal prediction.
- How it is used
- Applies learned feature relationships to supply-chain forecasting and other prediction decisions.
- How deep it goes
- Explains nodes, leaves, splits, and error-minimizing questions, while stopping short of detailed growth algorithms.
- Examples
- Uses Guess Who? and a demand dataset involving brand, price, promotion, and historical demand.
- What you can do after
- Evaluate decision-tree paths by identifying features, splits, terminal predictions, and the rationale for question selection.
Read how Demand Forecasting Best Practices explains decision tree →
Data-Driven Cybersecurity
A predictive model that recursively partitions data through feature-based decision rules arranged in a tree structure.
- How it is used
- Uses sequential feature-based decisions to classify cybersecurity activity and support threat-detection analysis.
- How deep it goes
- Explains nodes, branches, leaves, and root-to-leaf paths, but stops short of detailed training internals.
- Examples
- Illustrates trusted senders, login attempts, network traffic, phishing detection, and safe-versus-threat leaf outcomes.
- What you can do after
- Evaluate decision-tree-based classification within practical cybersecurity threat-detection workflows.
Applied Reinforcement Learning
A decision tree is a tree-shaped model in which internal nodes represent tests or decisions and leaf nodes represent outcomes.
- How it is used
- Uses decision trees to represent business choices and consequences, alongside other tree structures used in search and planning.
- How deep it goes
- Defines decision nodes and outcomes, then sketches routing branches and costs without developing a decision-tree learning algorithm.
- Examples
- Uses a demand threshold leading to a promotion outcome and a depot branching into delivery routes.
- What you can do after
- Understand how a tree represents decisions, branches, and outcomes in a business or routing scenario.
Read how Applied Reinforcement Learning explains decision tree →
Also covered in
- Transfer Learning for Natural Language Processing
- Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI
- Practical Automation with PowerShell: Effective scripting from the console to the cloud
- Effective Platform Engineering
- "Looks Good to Me"
- Grokking Data Structures
- Cyber Threat Hunting
What to know first
- linear regressionLinear regression is a statistical method that models a numeric response as a linear function of one or more predictor variables with fitted parameters.
- machine learningMachine learning is a field of computational methods in which systems learn patterns or relationships from data to make predictions, decisions, or other outputs.
- random forestA random forest is an ensemble learning model that aggregates predictions from multiple decision trees trained with randomized data samples, feature subsets, or both.
- accuracyAccuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
Related concepts
- leaf nodehas part · A leaf node is a terminal node in a tree or hierarchy that has no child nodes.
- random forestpart of · A random forest is an ensemble learning model that aggregates predictions from multiple decision trees trained with randomized data samples, feature subsets, or both.
- decision nodehas part · A decision node is a tree node where a decision, test, or action selection determines which successor branch is followed.
- language modelkind of · A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- decision stumpincludes · A decision stump is a decision tree of depth one with a single decision node and prediction leaves.
- XGBoostused by · XGBoost is an open-source software library for efficient, scalable gradient-boosted decision-tree algorithms.
Questions about decision tree
What is decision tree?
A decision tree is a tree-structured model or representation in which successive tests or choices lead through branches to outcomes, predictions, or actions.
Which Manning books explain decision tree?
Grokking Machine Learning, Statistics Every Programmer Needs, Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI, Ensemble Methods for Machine Learning, Timeless Algorithms, The Foundational Ideas, Grokking Machine Learning, Second Edition, Statistics Slam Dunk, Outlier Detection in Python and 10 more.
What should I know before learning decision tree?
Manning books that teach decision tree usually introduce linear regression, machine learning, random forest and accuracy first.
What kinds of decision tree are there?
Kinds of decision tree include decision stump.
What is decision tree a kind of?
Decision tree is a kind of language model. A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
What is decision tree part of?
Decision tree is part of random forest. A random forest is an ensemble learning model that aggregates predictions from multiple decision trees trained with randomized data samples, feature subsets, or both.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

















