Instance-based Learning

Machine Learning

Jesus A. Gonzalez

February 16, 2020

Instance-based Learning

Instance-based Learning

k-nearest neighbors

k-nearest neighbors - Algorithm

k-nearest neighbors - Algorithm

\[d(x_i, x_j) = \sqrt{\sum\limits_{r=1}^{n}(a_r(x_i)-a_r(x_j))^2}\]

k-nearest neighbors - Algorithm

k-nearest neighbors - Algorithm

k-nearest neighbors - Continuous classifications

\[f(x_q) = \frac{\sum\limits_{i=1}^{k}f(x_i)}{k}\]

k-nearest neighbors - Weighted Distances

k-nearest neighbors - Weighted Distances

\[f(x_q) = \arg\max\limits_{v \in V} \sum\limits_{i=1}^{k}w_i\delta(v,f(x_i))\]

where: \(w_i = \frac{1}{d(x_q,x_i)^2}\), if \(d\) = 0, then \(w\) = 0.

k-nearest neighbors - Weighted Distances

k-nearest neighbors - Note

k-nearest neighbors - Note

k-nearest neighbors - Note

k-nearest neighbors - Note

k-nearest neighbors - Note

Locally Weighted Regression

Locally Weighted Regression

\[\hat{f}(x)=w_0+w_1a_1(x) + \dots + w_na_n(x)\]

\[E(W) = \frac{1}{2}\sum\limits_{x \in D} (f(x) - \hat{f}(x))^2\]

Locally Weighted Regression

Locally Weighted Regression

Locally Weighted Regression

\[\bigtriangleup w_i = \alpha\sum\limits_{x \in D} (f(x) - \hat{f}(x))(-a_{i,x})\]

Locally Weighted Regression

Locally Weighted Regression

Locally Weighted Regression

\[E(W) \frac{1}{2} \sum\limits_{x \in k-nearest-neighbors} (f(x) - \hat{f}(x))^2\]

\[E(W) = \frac{1}{2}\sum\limits_{x \in D}(f(x) - \hat{f}(x))^2K(d(x_q,x))\]

\[E(W) = \frac{1}{2}\sum\limits_{x \in k-nearest-neighbors}(f(x)-\hat{f}(x))^2K(d(x_q,x))\]

\[\bigtriangleup w_i = \alpha \sum\limits_{x \in k-nearest-neighbors} K(d(x_q,x))(f(x) - \hat{f}(x))(-a_{i,x})\]

Distance Measures

Distance Measures

where \(m_j\) is the scale factor in dimension \(j\) and \(M\) is a diagonal matrix with \(M_{ij}=m_j\)

Distance Measures

Aplying the Distance Measure

Aplying the Distance Measure

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Weight Functions or Kernels

Radial Basis Functions

Radial Basis Functions

\[K_u(d(x_u,x))=\frac{1}{\sqrt{2\pi}\sigma^2}e^{-\frac{1}{2\sigma^2}}d^2(x_u,x)\]

Radial Basis Functions

Radial Basis Functions

Radial Basis Functions

Radial Basis Functions

Case-based Reasoning

Case-based Reasoning