See also slides for curve fitting, regression, colab link

Transclude of thoughts/university/twenty-four-twenty-five/sfwr-4ml3/ols_and_kls.py

curve fitting.

how do we fit a distribution of data over a curve?

Given a set of data points

  • (or )

ols.

Ordinary Least Squares (OLS)

Let be the prediction of a model , is the error, minimize

In the case of 1-D ordinary least square, the problems equates find to minimize

Optimal solution

where , , ,

Hyperplane equation

where is the intercept (bias)

Homogenous hyperplane:

minimize

Thus we can find