๐Ÿ“˜ Lesson 7 of 7 ยท Applied Mathematics

๐Ÿค– Machine Learning Mathematics

Machine learning relies on a handful of core mathematical ideas from linear algebra, calculus, and statistics โ€” understanding these foundations demystifies how models actually learn from data.

Course progress: 100%

01 Key Concepts

Loss Function

A function that measures how wrong a model's predictions are compared to the actual values; training a model means trying to minimize this function.

Gradient Descent

An optimization algorithm that repeatedly adjusts a model's parameters in the direction that most reduces the loss function, using its gradient (derivative).

Learning Rate

A small constant that controls how big each step is during gradient descent; too large risks overshooting, too small makes training very slow.

Vectors and Matrices in ML

Data (like an image or a row of features) is typically represented as a vector, and datasets as matrices, so that models can use fast matrix operations to make predictions.

Overfitting

When a model learns the training data too precisely, including its noise and quirks, causing it to perform poorly on new, unseen data.

02 Key Formulas

03 Solved Examples

Example 1 A model has a parameter w=5, learning rate 0.1, and the gradient of the loss at w=5 is 4. Find the updated parameter.
  1. Apply the update rule: w_new = w_old - (learning_rate * gradient).
  2. = 5 - (0.1*4).
Answer: w_new = 4.6
Example 2 Why is the learning rate important in gradient descent?
  1. A learning rate too large can cause the algorithm to overshoot the minimum and even diverge.
  2. A learning rate too small can make training take an impractically long time to converge.
Answer: It balances training speed against the risk of overshooting the optimal solution
Example 3 A model achieves 99% accuracy on training data but only 60% on new test data. What problem does this indicate?
  1. A large gap between training performance and new-data performance is a classic warning sign.
  2. The model has likely memorized quirks specific to the training set rather than learning generalizable patterns.
Answer: Overfitting

04 Practice Questions

1What does a loss function measure?
How wrong a model's predictions are compared to actual values
2What algorithm minimizes a loss function by following its gradient?
Gradient descent
3What happens if the learning rate is set too high?
The algorithm may overshoot and fail to converge
4What is 'overfitting'?
When a model performs well on training data but poorly on new, unseen data
5Why are vectors and matrices used to represent data in machine learning?
They allow fast, structured mathematical operations across large datasets

๐Ÿ“„ Machine Learning Mathematics โ€” Downloadable Worksheet

10 questions with a full answer key. Grab the PDF to print, or try the interactive version in your browser.