Machine Learning Foundations
Learn how machines learn from data: implement regression, trees, metrics, k-means, PCA and anomaly detection from scratch in NumPy, and practise honest evaluation.
Leads to: Data Scientist, Machine Learning Engineer
Before you start
This course builds on Intro to Data Analysis with Python, Calculus & Linear Algebra for STEM and Probability & Statistical Inference. Take them first if you are new to the topic.
About this course
An intermediate course for data scientists and machine learning engineers. You will frame problems as supervised or unsupervised learning, split data without leakage, and train models with gradient descent. You will build linear and logistic regression, decision trees and a small random forest, and choose metrics that stay honest when classes are imbalanced. In the unsupervised module you will cluster customers with k-means, compress features with PCA and flag outliers with an isolation forest. The last module covers responsible practice: feature engineering, checking a model for unfair group disparities, and tuning hyperparameters with cross-validation. Every algorithm is written from scratch in NumPy in the browser, and each lesson shows the scikit-learn equivalent you will use at work. Prerequisites: Intro to Data Analysis with Python, Calculus & Linear Algebra for STEM, and Probability & Statistical Inference.
Course content
Module 1
How Machines Learn
3 lessons · 1h 47mFrame problems as supervised or unsupervised learning, split data without leakage, and train a model with gradient descent.
- 24mWhat ML isReading
Frame a real problem as supervised regression, supervised classification or an unsupervised task, with the right features and baseline.
- 23mTrain, validation, and testReading
Split data into training, validation and test sets reproducibly, and keep test information from leaking into training.
- 1hGradient descentReading
Train a straight-line model by repeatedly stepping against the gradient of the mean squared error.
Module 2
Supervised Learning
3 lessons · 2h 15mLinear and logistic regression, decision trees and random forests, and the metrics that show whether a classifier is any good.
- 52mLinear and logistic regressionReading
Fit linear regression for numbers and logistic regression for yes/no labels, and read their coefficients correctly.
- 44mTrees and ensemblesReading
Grow decision trees with Gini impurity and combine many of them into a random forest.
- 39mEvaluation metricsReading
Use the confusion matrix, precision, recall, F1 and ROC AUC to judge classifiers when classes are imbalanced.
Module 3
Unsupervised Learning
3 lessons · 1h 29mGroup similar rows with k-means, compress correlated features with PCA, and flag unusual records with an isolation forest.
- 24mClusteringReading
Segment customers with k-means, choose the number of clusters, and describe each segment in plain terms.
- 44mDimensionality reductionReading
Compress many correlated features into a few principal components and read what they mean.
- 21mAnomaly detectionReading
Score how unusual each row is with an isolation forest and flag the readings worth reviewing.
Module 4
Responsible Practice
3 lessons · 1h 18mTurn raw columns into model-ready features, check models for unfair group disparities, and tune hyperparameters honestly with cross-validation.
- 31mFeature engineeringReading
Encode categories, scale numeric features and build useful inputs, then see the effect on a k-NN classifier.
- 8mFairness and biasReading
Find where bias enters a model and check it for group disparities with selection rates and error rates.
- 39mCross-validation and tuningReading
Choose hyperparameters honestly with k-fold cross-validation and grid search, then test once.