Docsity

Machine Learning per l'Ingegneria Biomedica: Applicazioni e Tecniche, Appunti di Machine learning

Anteprima parziale del testo

Scarica Machine Learning per l'Ingegneria Biomedica: Applicazioni e Tecniche e più Appunti in PDF di Machine learning solo su Docsity!

Machine Learning for

Biomedical Engineering

Enrico Grisan

[email protected]

ML: what is it really useful for

Just ahead of the kickoff for Season 6 of the television series “Games of Thrones,” computer science students at the Technical University of Munich have implemented a project that answers questions preoccupying fans of the series: Has Jon Snow survived Season 5? Who is going to die next? The students used an array of machine learning algorithms to answer these questions. The algorithm, which accurately predicted 74 percent of character deaths in the show and books, has many surprises in store, placing a number of characters thought to be relatively safe in grave danger.

Framework of unsupervised learning

Given a data set (𝑥 1 , … , 𝑥𝑁) where 𝑥𝑖∈ 𝒳 ⊆ ℝ 𝐷 Define some model on the data Goal Learn structure within the data set, as defined by the model

Motivation

Thinking at (𝑥, 𝑦) as a random variable with joint probability 𝑝(𝑥, 𝑦), unsupervised learning factorizes as 𝑝 𝑥, 𝑦 = 𝑝 𝑦 𝑥 𝑝(𝑥)

The focus is on 𝑝(𝑥)!

Unsupervised learning

Clustering

Partition the data into groups:

  • observations within a group are “similar”
  • observations in different groups are “dissimilar.” Given the data set (𝑥 1 , … , 𝑥 𝑁 ) Assume that each data point belongs to exactly one group (cluster) Task : find the clusters, given only the data

What is similarity?

Hard to define similarity! But we now intuitively when we see it!

Practical approach: instead of subjective similarity use distance

between random variables

K-means

Given a set of observations (𝑥

) where 𝑥

K-means clustering

Partitition the 𝑁 observation into 𝐾 sets (K ≤ 𝑁) or

clusters 𝐶 = {𝐶

} such that the within-cluster

distances are minimized:

𝜇, 𝑐 = arg lim

= arg lim

K-means

𝜇^3

In K-means clusering the centroids 𝜇

are the means of

the cluster 𝐶

The problem is NP hard …

Selective optimization

We want to minimize L μ, c =

Splitting the variables into two unknown sets μ and c

we have that

1) Given μ we can find c in closed form

2) Given c we can find μ in closed form

Given 𝝁 update c

Each 𝑐𝑗 is independent from the others, given 𝜇:

L μ, c =

𝑘= 1 𝐾

2

𝑘= 1 𝐾

2 Distance of 𝑥 1 to the assigned centroid Distance of^ 𝑥𝑁 to the^ assigned^ centroid

L is minimized with respect to each 𝑐𝑗 by assigning each data 𝑥𝑗 to the

closest centroid, separately point by point:

𝒌

𝟐

Since the are only K options, there are no derivatives: compute all

possible (K) values and pick the smallest

Given c update 𝝁

Notice that for a given 𝑐, we can break 𝐿 into subgroups defined

by the partition of the data according to 𝑐.

For each 𝑘, we then optimize:

𝜇𝑘 = arg min

𝑣 𝑖= 1 𝑁

2

Let 𝑛𝑘 =

𝑖= 1 𝑁

𝐻 𝑐𝑖 = 𝑘 , by taking the derivative and setting it

to zero we obtain the close-form solution:

𝟏 𝒏𝒌 𝒊=𝟏 𝑵

K-means in practice

Iteration 1

Assign data to clusters

K-means in practice

Iteration 1

Update the centroids

K-means in practice

Iteration 2

Update the centroids

K-means in practice

Iteration 3

Assign data to clusters