ML

What is it?

Ability to acquire knowledge by extracting pattern from the raw data

Taxonomy

Supervised Learning

Un Supervised Learning

Classification

Regression

Density Estimation

Structure Analysis

Linear regression is used to predict the value of a continuous variable Y based on one or more input predictor variables X

Evoluation

Problem

ˆyi=f(xi)=w0+w1xi

Linear Solution

Quadratic solution

Cubic solution

5-power solution

n-th power solution

Multiple Regression

There are two or more predictors

Problem

\(f(\mathbf{x}_i) = \mathbf{w}^T \mathbf{x}_i = w_0 + w_1 x_{i1} + \cdots + w_K x_{iK}\)

\(\mathbf{w} = [w_0, w_1, \cdots, w_K]^T\)

Solution

.

Models

Linear

Polynomial

Sinusoids

Radial basis functions

Splines

And many more! ...

Root Mean Square Error
\( E_{\text{rms}} = \sqrt{\frac{1}{N}\sum_{i=1}^N (y_i - \hat{y}_i)^2}) \)


where \( y_i \) is the true value and \( \hat{y}_i\) is the predicted value.

Mean absolute error
\( E_{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i| \)

Mean Squared Error
\(E_{MSE} = \frac{1}{N} \sum_{i=1}^N e_i^2 = \frac{1}{N} E_{SSE}\)

R-Squared
\( E_R = 1 - \frac{\sum e_i^2}{\sum(y_i - \bar{y})^2} \)


where \( \bar y = \frac 1 N \sum y_i \)

Sum of squared Errors
\(E_{SSE} = \frac{e_1^2 + e_2^2 + \cdots + e_N^2} {N} = \frac{1}{N} \sum_{i=1}^N e_i^2\)
\( e = y_i - \hat{y_i} \)

Degrees of freedom

A linear model \( y = w_0 + w_1x \) has two parameters and is inflexible, as it can only generate straight lines.

A cubic model \(y = w_0 + w_1x + w_2x^2 + w_3x^3 \) has 4 parameters and is more flexible than a linear one.

Under-fitting

Over-fitting

Just Right

.

Methodologies

Sampling

Deployment performance

Optimisation theory

Error Surface

Gradient descent


\( w_{new} = w_{old} − \epsilon ∇E(w_{old}) \)

Parameter tuning

Hierarchical clustering

Feature Engineering