Search⌘ K
AI Features

Linear Regression

Explore the fundamentals of linear regression, focusing on function approximation using least squares. Understand how to estimate parameters of linear models to fit data points and apply this knowledge using Python for practical data science problems.

Function approximation

Approximating a function means estimating the values of its parameters. Consider the SSE function we discussed in the previous lesson.

SSE(w^)=(Aw^b)T(Aw^b)SSE(\bold{\hat w})=(A\bold{\hat w}-\bold{b})^T(A\bold{\hat w}-\bold{b})

Approximating SSE means estimating the vector, w\bold w, that nearly satisfies the linear system, also called the linear least squared error solution.

Formal definition

Consider a data set, D={(x1,y1),(x2,y2),...,(xn,yn)}D=\{(\bold{x_1},\bold{y_1}),(\bold{x_2},\bold{y_2}),...,(\bold{x_n},\bold{y_n})\}, where each entry is a pair, xi\bold{x_i} and yi\bold{y_i}, of objects (scalars, vectors, matrices, and so on). Function approximation seeks a function, fwf_\bold{w}, such that:

fw(xi)yif_\bold{w}(\bold{x_i})\approx\bold{y_i}

Example

Let D={(4,1),(3,9)}D=\{(4,1),(-3,9)\}. The function ...