liveBook · Manning

Split

As explained in Statistics Every Programmer Needs

A split is a decision rule that partitions observations at a decision-tree node according to a feature and condition.

A split is a decision rule that partitions observations at a decision-tree node using a feature and condition. Internal nodes apply splits, while leaf nodes stop splitting and provide predictions. section 6.3.6

Decision trees begin with a root split and continue through internal nodes. Interpret each prediction by following the branches whose conditions match the feature values until reaching a leaf. section 6.3.6

Practical characteristics of splits include:

  • Use conditions such as TO_GO <= 3.5; Python can place thresholds between integer feature values without harming predictive accuracy. section 6.3.5
  • Choose the root decision by identifying the split that best separates the classes; later splits refine the resulting groups. section 6.3.6
  • Reduce the number of splits through pruning, producing a smaller tree with fewer features and an easier visual interpretation. section 6.3.5

Splitting fourth-down conversion data

Partitioning observations at TO_GO <= 3.5 produces 127 failures and 268 conversions; observations above 3.5 produce 156 failures and 67 conversions. Further splits on PLAY_TYPE and SCORE_DIFFERENTIAL distinguish running and passing plays and lead to conversion predictions.

>>> from sklearn import tree
>>> plt.figure()
>>> tree.plot_tree(clf, feature_names = ['QUARTER',
>>>                                      'TO_GO',
>>>                                      'OFFENSIVE_TEAM_VENUE',
>>>                                      'SCORE_DIFFERENTIAL',
>>>                                      'PLAY_TYPE'],
>>>                class_names = ['0', '1'],
>>>                filled = True,
>>>                rounded = True
>>>                fontsize = 12)
>>> plt.tight_layout()
>>> plt.show()

Plot a fitted scikit-learn tree to inspect its feature-based conditions, class labels, node colors, and pruned structure. section 6.3.5

How Statistics Every Programmer Needs covers it

How deep it goes
Explains thresholds, node traversal, root selection, and pruning, but does not develop impurity or pruning mathematics.
Examples
Uses TO_GO, PLAY_TYPE, and SCORE_DIFFERENTIAL thresholds to classify fourth-down conversion attempts.
What it assumes
Assumes basic feature and class understanding while teaching node structure and branch-following interpretation directly.
What you can do after
Evaluate tree predictions by tracing feature conditions from the root through internal nodes to a terminal leaf.
How it connects
Connects decision trees with root nodes, internal nodes, leaf nodes, pruning, impurity, classification, and regression.

Also explained in

Compare how 2 books explain split →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.