Docsity

Lecture 18: Clustering and Soft Clustering using Gaussian Models, Study notes of Computer Science

Partial preview of the text

Download Lecture 18: Clustering and Soft Clustering using Gaussian Models and more Study notes Computer Science in PDF only on Docsity!

Lecture 18Lecture

Nov 07 2008

ReviewReview

-^

ClusteringClustering– Grouping similar objects into clusters

-^

Hierarchical clusteringHierarchical clustering– Agglomerative approach (HAC): iteratively merge

similar clusters

  • Different linkage algorithms for computing distances

among clusters

-^

Non hierarchical clustering

-^

Non hierarchical clustering– K-means: start with a set of initial seeds (ceners),

iteratively go through reassignment and recenteringiteratively go through reassignment and recenteringsteps until convergence

Soft vs hard ClusteringSoft

vs hard Clustering

• Hard clustering:

Hard clustering:– Data point is deterministically assigned to one

and only one clusterand only one cluster

  • But in reality clusters may overlap

• Soft clustering:• Soft-clustering:

  • Data points are assigned to clusters with

certain probabilitiescertain probabilities

How can we extend Kmeans to

k

f^

l^

i

make soft clustering

•^

Given a set of clusters centers

μ

μ

μ

, instead ofk

μ^1

,^ μ

,^

μk

directly assign all data points to their closest clusters, wecan assign them

partially based on the distances

•^

If each point only partially belongs to a particular cluster

-^

If

each point only partially belongs to a particular cluster, when computing the centroid, should we still use it as if itwas fully there?

Side track: Gaussian DistribtuionSide

track: Gaussian Distribtuion

  • Univariate Gaussian distribution:

Univariate Gaussian distribution:

N(

μ,

σ

2 )

μ^

−^

mean

,^ center of the mass

(^2) σ −

standard deviation, spread of the mass

  • Multivariate Gaussian distribution:

N(

μ,

Σ) μ^

− (μ

,^1 μ^2

)

Σ^

−^

Covariance matrix

σ^1

2

σ^12 σ^12

σ^2

2

Mixture of Gaussians

•^

Assume that we have k clusters in our data

-^

Each cluster contains data generated from a Gaussian

-^

Each cluster contains data generated from a Gaussiandistribution

-^

Overall process of generating data:

p^

g

g

  • first randomly select one of the clusters according to a prior

distribution of the clusters

  • draw a random sample from the Gaussian distribution of that

draw a random sample from the Gaussian distribution of thatparticular cluster

•^

Similar to the generative model we have learned inBayes Classifier difference?Bayes Classifier, difference?– Here we don’t know the cluster membership of each data point

(unsupervised)

A simpler problemA

simpler problem

-^

If we know the parameters of each Gaussian:If we know the parameters of each Gaussian: (μ

  • we can compute the probability of each data point

belonging to each cluster

) (

) ( ) | ( ) |

(^

i

i

i^

P

C P C x x P x C x

P^

∈

=

∈

)]

(

)

1 (^2

exp[

) (^2) (

1

) (

) |

(

1

(^2) / 1 (^2) /

i

i T i

i d

i

i

x

x x P

μ

μ

π

α^

− Σ − − Σ ∗ ∝ −

-^

The same as in making prediction in Bayesclassifierclassifier

Another simpler problemAnother

simpler problem

• If we know what points belong to cluster i,

If we know what points belong to cluster i,we can estimate the gaussian parameterseasily:

y

i j^ C

j

i

i^

n^

x

x

1

ˆ μ^

T

C

i j i j i i

i j n^

x

(x

(x

•^

What we have is slightly different

Clusterprior

Clustermean

Cluster covariance

• What we have is slightly different –

  • For each data point x

j , we have P(x

j ∈C

|xi

j ) for

i=1,2,…, Ki 1,2,…, K

A procedure similar to KmeansA

procedure similar to Kmeans

-^

Randomly initialize the Gaussian parametersRandomly initialize the Gaussian parameters

-^

Repeat until converge1.^

Compute

for all data points and all ) |

(^

j i j^

C

P^

x

x^

∈

Compute

for all data points and all

clustersThis is called the E-step for it computes the expected values of

the cluster memberships for each data point

) |

(^

Ci

P^

x

x^

∈

the cluster memberships for each data point

Re-compute the parameters of each GaussianThis is called the M-step for it performs maximum likelihood

estimation of parameters