18 min total

Machine Learning

Linear regression & cost functions

Linear regression & cost functions

Start with a prediction and a cost function. The goal is to connect the error we measure to the parameters we can change.

Cost functions

We call a cost function 'cost' because the model weights are costing us this much error

Learning a regression model — illustration
Learning a regression model — illustration

using different cost functions models cost graph differently allowing us to optimize better

Squared error and absolute error

When using squared error, the outliers results in more taller bumps in cost function graph which results is faster convergence

Absolute mean square error partial derivate:

Learning a regression model — illustration

Gradient descent visualization

Learning a regression model — illustration