Week 15 · November 30–December 2

Control model complexity and compare predictions.

Continue the wildfire PM2.5 example with cross-validation, regularized regression, and decision trees. Use the same training and test observations to compare models and explain how tuning changes their predictions.

This week

Cross-validation

  • Explain the bias–variance trade-off and the purpose of validation folds.
  • Choose tuning settings using the training data.

Regularized regression

  • Compare ordinary least squares, lasso, ridge, and elastic net.
  • Interpret coefficient shrinkage and compare prediction errors.

Decision trees

  • Fit regression and classification trees with wildfire variables.
  • Control tree complexity through tuning and pruning.

Lecture slides

Scroll to move through this Week page. Use the left and right controls shown in each preview to move through the slides.

Lecture 11 · Cross-Validation and Regularized Regression Open full screen ↗

Lecture 12 · Decision Trees Open full screen ↗

Classwork

Classwork 9: Regularized Linear Regression — Wildfire Smoke and PM2.5

Fit regularized regression models with glmnet, use cross-validation to choose the penalty, and compare their test errors with ordinary least squares.

Classwork 10: Decision Trees and Pruning with Wildfire Smoke Data

Fit regression and classification trees with rpart, examine how tuning affects tree growth, and compare a pruned tree with its larger counterpart.

Both classworks use the prepared wildfire variables and the 80/20 random split introduced in Classwork 8. The outcome is total monthly monitor PM2.5. This split evaluates prediction for held-out historical county-months using observed inputs. A forecast for future years would require a different split and a check of predictor availability.

By the end of Week 15

Be ready to explain how cross-validation guides tuning, how regularization and pruning control complexity, and what your prediction errors say about model performance. Keep your model comparison and code ready for the ensemble models that follow.

This week’s materials

Back to top