Skip to content

ML module Week 2 Topic 3: Linear regression #49

@EricThomson

Description

@EricThomson

Once the students appreciate the world of ML, and the general scikit-learn ecosystem, let's dig into detail into linear regression, the goal is to train and evaluate a regression model using scikit-learn.

  1. Discussion of linear regression: what is it, how is it connected to linear correlation from week 1.
  2. Use scikit learn to create model, do model fit, and model prediction (using the standard three-part scikit-learn api). Lots of data points with noisy data.
  3. Evaluate model fit with visualizations, and metrics like MSE and R2 (explain these metrics)
  4. Break data into training/test data to illustrate generalization
    Use the extremelyl important test_train_split function to break data into test/train data and explain why we are doing this (to avoid overfitting!)
    Show polynomial regression to illustrate overfitting (here let's do it with few data points to illustrate the point of lack of generalization).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions