Learn Machine Learning from First Principles using JavaScript

Learn Machine Learning from First Principles using JavaScript

Categories: JavaScript
Wishlist Share

About Course

This course teaches machine learning by building it from scratch in JavaScript. No TensorFlow, no scikit-learn, no libraries at all. If you can write a for loop, you can follow it.

How it works

Each section starts with a question. You try to answer it first, then the formal idea is introduced, so you know why it exists before you learn its name.

Every concept is explained in full. No step is skipped and no symbol is left undefined. We work out the maths before we use it.

Everything is drawn on screen. You build small canvas demos: drag a line and watch the error change, watch gradient descent step downhill, watch a decision boundary move, watch a network train.

What you build

Linear regression, gradient descent, logistic regression, a small matrix library, a neural network with backpropagation, k-nearest neighbors, k-means clustering, decision trees, and a handwritten digit recognizer you can draw into.

What you need

Basic JavaScript and school-level maths. No prior machine learning.

Show More

What Will You Learn?

  • Write linear regression, logistic regression and a neural network from scratch in JavaScript
  • Derive gradient descent and backpropagation yourself instead of taking them on trust
  • Draw every concept on canvas so you can see what the maths is doing
  • Read the standard notation without being thrown by it
  • Work out why a model is underfitting, overfitting, or not training at all
  • Build a handwritten digit recognizer with no libraries
  • Understand what machine learning frameworks do for you, and what they hide

Course Content

How does a machine learn?
Before any maths, we look at what learning from examples actually means, and write a tiny program that improves on its own.

  • Can a program get better at a task?
  • A guessing game you already know how to play
  • Rules versus examples
  • A learning program in twenty lines
  • Naming the parts: model, parameters, loss
  • Why we use JavaScript for this
  • Setting up a playground with no dependencies

Data as points and vectors
We turn raw measurements into numbers a model can use, and learn to picture a dataset as points in space.

Fitting a straight line
The simplest useful model. We define what makes a line wrong before we try to make it right.

Gradient descent
The method behind almost all machine learning. We work out the maths by hand first, then write it.

More than one feature
Real problems have many inputs. We introduce matrices only as a way to keep the bookkeeping tidy.

Classification
Predicting a category instead of a number, and why that small change breaks everything we built so far.

Neural networks
We find a problem a straight line can never solve, and build the network that solves it.

Backpropagation
How a network works out which weight to blame. Done on paper for two neurons before any code.

Training that actually works
The practical problems that stop models learning, and the standard fixes for each one.

Other ways to learn
Methods that are not gradient descent, including what to do when the data has no labels.

Capstone: a digit recognizer
One project that uses everything: a network you can draw digits into, written with no libraries.

Student Ratings & Reviews

No Review Yet
No Review Yet