{
"cells": [
{
"cell_type": "markdown",
"id": "dedefa38",
"metadata": {},
"source": [
"## Machine Learning\n",
"### Linear regression with least squares\n",
"In **linear regression**, we assume we can model the data points with a linear function as:\n",
"
$y=w_0+w_1x_1+w_2x_2+....w_{p-1}x_{p-1}$\n",
"
Given data points $(\\boldsymbol{x}_i,y_i)$ we may find the best estimate for parameter vector $\\boldsymbol{w}$ using the **least squares method**:
\n",
"$\\boldsymbol{w}=X^+ \\boldsymbol{y}$\n",
"
where $X^+=(X^TX)^{-1}X^T$, and it it called the **pseudo-inverse** of $X$. \n",
"
**Reminder:** The rows of matrix $X$ are composed of $\\boldsymbol{x}_i$ such the the first column is all one.\n",
"