The Regression

Suppose we observe a real valued input x and we wish to use the observation to predict the value of a real-valued target variable y

Applications:

  • Financial domain: house price, stock market, etc
  • Healthcare domain: vital measurements are in real value

House Buying Example Problem

Problem: You want to predict how much a house is worth. Target: Actual price for house as denoted as y Input Features:

  • number of bedrooms
  • number of bathrooms
  • living sqft
  • etc. etc.

Predictive Model

  • Input:
  • Output:
  • Functional Form:
    • infinitely many

Note: Another form this function can take is .

To convert between to :

How to Find a Good Model?

Criteria: Compare the true value vs the estimated value via a squared loss

Linear Regression:

Matrix Form:

Note that may be excluded, it can be counted as a part of .

Re-Parametrization

Tilde implies a re-parametrization, that the bias term is being included in the w and x term.

Matrix Derivative

Gradient of a function

In many machine learning problems, the objective involves a function
that takes a vector of variables as input, e.g.,

Suppose the first partial derivatives of 𝑓 exist, the gradient of 𝑓 (denoted
by ∇𝑓 ) is the vector field whose ith component is the ith partial derivative. (Jacobian)

Solving Least Squares Problem

Given:

Use these equations to solve for :

Solution:

set the gradient equal to zero to find the minimum:

Note: Rank deficiency problem. When is close to singular, we would have numerical problems. The solution is to add regularization (Ridge Regression).

Ridge Regression

Ridge Regression has the formula where

Solving for the analytical solution:

set the gradient equal to zero to find the minimum:

The gradient also has the formula