AI Glossary / Graphs and symbolic AI / Intermediate
CART
Definition
CART stands for Classification and Regression Trees, a methodology for learning decision trees from labeled data. It recursively divides examples into two groups using feature-based tests. A classification tree predicts a category, while a regression tree predicts a numerical value. The resulting tree represents a sequence of decisions leading to a prediction at a leaf.
What it means
A CART-style tree learns where to split the data rather than requiring a person to write every decision rule. For example, it may first separate observations by a measurement threshold and then apply another test within each group. This creates regions whose examples have more similar target outcomes.
The visible rules can make a small tree relatively easy to inspect. However, the splits describe predictive patterns in the training data, not necessarily causal relationships. A large tree can become hard to understand, and even a simple-looking tree can reproduce misleading patterns if its labels, features, or evaluation process are flawed.
How it works
Training considers candidate binary splits at a node and selects a split that improves a chosen criterion. Classification commonly uses impurity measures such as Gini impurity; regression commonly uses reduction in squared prediction error. The process repeats within the resulting child nodes.
Growing a tree too far can fit peculiarities of the training sample. CART methodology therefore includes controlling tree complexity, notably through pruning, while implementations also offer growth limits. Prediction follows the learned tests from the root to a leaf. With squared-error regression, a leaf typically predicts its training targets' mean; classification uses the class distribution in the leaf to form a prediction.
Three practical examples
- A support team predicts a request category from recorded characteristics, then inspects a small tree's decision paths.
- An operations analyst estimates handling time from task attributes using a regression tree.
- A model-development team uses a shallow tree as an interpretable baseline before deciding whether a more complex predictor adds useful accuracy.
Think of it this way
Think of a flowchart whose questions and thresholds are learned from examples. Each answer directs the case toward a final prediction. The analogy is limited because a learned tree is not a policy handbook: its rules reflect statistical associations and training choices, not automatically approved business procedures or explanations of cause.
Worked example
Consider six training cases sorted by feature x: x values 1, 2, 3, 4, 5, and 6, with numerical targets 2, 2, 4, 8, 8, and 10. Without a split, the predicted mean is 34 divided by 6, about 5.667. The total squared error is about 59.333.
For a candidate split at x = 3.5, the left targets are 2, 2, 4, with mean 2.667 and squared error about 2.667. The right targets are 8, 8, 10, with mean 8.667 and the same squared error. Total error becomes about 5.333, a reduction of 54. A new case with x = 3 follows the left branch and receives prediction 2.667 in this one-split tree. This demonstrates evaluation of one candidate split. A training algorithm compares the allowed candidates, and improvement on these training cases alone does not establish performance on new data.
Illustrative case study
At fictional Rowan Logistics, an analyst builds a small regression tree to estimate processing duration. Staff inspect its paths and notice that one split uses a field populated only after processing finishes. The analyst removes that unavailable predictor and repeats evaluation using only information available at prediction time.
The fictional case illustrates that a readable tree can expose a data-leakage problem, but readability does not prevent the problem automatically. No forecasting improvement is claimed, and the example does not turn a learned split into a causal explanation of processing time.
Common misconceptions and mistakes
CART is not synonymous with every decision-tree algorithm; other tree methods use different split and pruning choices. A binary tree also does not mean a two-class problem. Each node has two branches, but classification can involve more than two target classes.
A very deep tree can memorize training examples, and small data changes can alter the learned structure. Feature importance from a tree is not proof of causation or fairness. Finally, implementations differ in supported data types, missing-value handling, criteria, and pruning options, so a general CART description should not be mistaken for a complete software specification.
Business use
Businesses can use CART-style trees when they need an understandable predictive baseline or nonlinear relationships expressed through simple tests. Validation should reflect how the model will be used, including timing, changing data, and the cost of errors. Inspect the size and stability of the tree as well as its predictive score. If people will act on a leaf prediction, explain what training evidence supports it and avoid presenting tiny leaves as certain conclusions.
People also ask
Does CART handle both classification and regression?
Yes; the target type and training criterion determine the task.
Does binary splitting restrict the output to two classes?
No. Binary refers to the two children created at each split.
Is a decision tree automatically interpretable?
A small tree can be easy to follow, but large trees, unstable splits, and poorly defined features can undermine useful interpretation.
Check your understanding
A regression-tree split greatly reduces training error. Does that prove it improves future predictions?
Answer: No. The split may fit sample-specific patterns; evaluate the resulting model on appropriate held-out data or through a suitable validation procedure.
Related terms
- Decision tree
- Recursive partitioning
- Gini impurity
- Overfitting
- Random forest
- regression
- cost-complexity pruning
Learn next
Recalculate the means and squared errors in the worked example, then try another candidate threshold. Keep a separate set of cases for evaluating the final tree. This separates the split-selection process from evidence that the learned rules generalize.
More in Graphs and symbolic AI
- Brute-force search - Brute-force search solves a problem by systematically generating candidate answers and checking them directly, with little or no problem-specific guidance...
- Business rules engine - A business rules engine is software that evaluates explicitly defined rules against business data and determines which conclusions or actions apply.
- Capacity Scaling Minimum Cost Flow - Capacity Scaling Minimum Cost Flow is a network-flow method that finds the least-cost way to satisfy specified supplies and demands while respecting edge...
- Cascaded finite-state transducers - Cascaded finite-state transducers are a sequence of finite-state processing stages in which one stage's output becomes input for the next.
- Case agreement - Case agreement is compatibility in grammatical case between words or phrases that a language's grammar requires to agree.
- Case-based planning - Case-based planning constructs a plan for a new situation by retrieving relevant previous planning experiences and adapting them.
Sources
Sources: scikit-learn, official decision-tree guide and CART discussion: https://scikit-learn.org/stable/modules/tree . Breiman, original technical material on CART-based tree methods: https://www.stat.berkeley.edu/~breiman/DB-CART.pdf . Original CART analysis research: https://arxiv.org/abs/1906.10086 .
Previous: Carryover effect Next: Cartesian Product