Conditional logic uses if-else rules to select outcomes from data. In a regression tree, each split asks whether a predictor is above or below a threshold, then sends observations along different branches. section 5.8
NBA wins and hustle statistics
A team averaging more than 26.05 points off screens per game is expected to win 50 or 51 regular-season games. Below that threshold, a second rule checks deflections: fewer than 12.85 suggests 27–37 wins, while more than 12.85 suggests 31–51 wins. section 5.8
fit3 <- tree(formula = wins ~ screen_assists_pts + deflections +
loose_balls + contested_2pt + contested_shots, data = train)
summary(fit3)
##
## Regression tree:
## tree(formula = wins ~ screen_assists_pts + deflections + loose_balls +
## contested_2pt + contested_shots, data = train)
## Number of terminal nodes: 10
## Residual mean deviance: 82.83 = 4722 / 57
## Distribution of residuals:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -17.2500 -5.6670 0.2857 0.0000 6.3330 21.0000
Inspect the fitted regression tree and its terminal-node summary to see how conditional splits produce grouped predictions. section 5.8




















