Skip to content

Day 01 — Part 2: Regression Algorithms

Regression is the foundation of predictive modelling. Before you can build a recommender, a churn predictor, or an anomaly detector, you need to understand how models learn to map inputs to a continuous output — and how to tell whether the resulting predictions are actually useful. This session covers the full regression toolkit: from the workhorse linear model to regularised variants to tree-based ensembles.

Session Overview

Difficulty: Beginner–Intermediate Reading time: ~2.5 hours | Exercises: ~2 hours Prerequisites: ML Basics (Day 01 Part 1) · NumPy array operations · Linear algebra basics (dot product, matrix multiplication) · Pandas DataFrames


Session Goals

By the end of this session you will be able to:

  • Explain what regression is, what loss functions are, and why optimisation is at the heart of every regression model
  • Fit a linear regression, read its coefficients, and diagnose whether its assumptions hold
  • Choose between Ridge, Lasso, and ElasticNet based on the structure of your data — not just a formula
  • Build and tune Decision Tree, Random Forest, and Gradient Boosting regressors
  • Pick the right evaluation metric for a given problem and interpret residual plots honestly

Session Map

# Topic File Estimated Time
1 Regression Overview 01-regression-overview.md 15 min
2 Linear Regression 02-linear-regression.md 30 min
3 Ridge, Lasso, ElasticNet 03-ridge-lasso-elasticnet.md 30 min
4 Tree-Based Regression 04-tree-based-regression.md 30 min
5 Regression Metrics 05-regression-metrics.md 20 min
6 Exercises 06-exercises.md 45 min

Total: ~2.5 hours including exercises


Prerequisites

Before this session you should be comfortable with:

  • Python, NumPy, and Pandas basics (Week 01)
  • Train/test splitting and the idea of generalisation error
  • Basic matplotlib for plotting

Difficulty

Intermediate. The concepts build on one another — read in order. If you skip ahead to Random Forests without understanding linear regression's assumptions, you will not understand why tree models exist or when they are the better choice.


01-regression-overview