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

