Docsity

Machine learning for bioengineering, Appunti di Machine learning

Anteprima parziale del testo

Scarica Machine learning for bioengineering e più Appunti in PDF di Machine learning solo su Docsity!

Machine Learning for

Biomedical Engineering

Enrico Grisan

[email protected]

1

A step into linear regression

Find a linear function

that minimizes the sum of squared residuals from 𝑦:

Least squares estimation

Geometry of least squares

The columns of 𝑿 span a

subspace of ℝ

The closest point to 𝑦 in this

subspace is its orthogonal

projection

The orthogonal projection is

given by the dot product

Least square estimation (2)

If we want to minimize the RSS

we can use the iterative scheme with Newton update:

Least square estimation (2)

1. Initialize 𝒘

2. Update

2. Check termination condition

a) 𝒘

b) |𝒘

c) 𝜏 > 𝑇𝑚𝑎𝑥

d) 𝑚𝑎𝑥 𝛻𝐿 < 𝜀

Least squares classifier

Why not using linear least

squares to fit regressors on

binary targets?

% fit yy = wwxx % ww = (D+1)x1 weights % xx = Nx(D+1) test cases % yy = Nx ww = xx\yy;*

Least squares classifier

(𝑿, 𝑌) with 𝑌 ∈ − 1 , 1

If 𝑓 𝒙 > 0 ⇒ 𝒙 ∈ 𝒞

If 𝑓 𝒙 < 0 ⇒ 𝒙 ∈ 𝒞

% fit yy = wwxx % ww = (D+1)x1 weights % xx = Nx(D+1) test cases % yy = Nx ww = xx\yy;*

Least squares classifier

What if there are outliers?

% fit yy = wwxx % ww = (D+1)x1 weights % xx = Nx(D+1) test cases % yy = Nx ww = xx\yy;*

Outlier group of data

Least squares classifier revisited Using the same procedure as for least squares: 𝑾 = (𝑿 𝑇 𝑿) − 1 𝑿 𝑇 𝒀 𝑓 𝒙 = 𝑾 𝑇 𝒙 𝐶 𝒙 = 𝑎𝑟𝑔 max 𝑘∈𝒞 𝑓 𝑘 (𝒙)

Least squares classifier revisited % fit YY = WWxx % ww = (D+1)xK weights % xx = Nx(D+1) test cases % yy = NxK ww = xx\yy;*

𝒚𝑖,𝑜𝑟𝑎𝑛𝑔𝑒 = [ 1 , 0 ]

𝒚𝑖,𝑙𝑒𝑚𝑜𝑛 = [ 0 , 1 ]

𝒙𝑖 = [ 1 , ℎ𝑒𝑖𝑔ℎ𝑡, 𝑤𝑖𝑑𝑡ℎ]

Least squares classifier revisited 𝒚 2 ~ 0 𝒚 2 ~ 1 % ww = 3x2 weights % xx = 1x3 test cases % yhat = 1x yhat = xxww; [~,chat]=max(yhat);*

Case study 1:

olive oil origin identification