Docsity

Clustering: Distance Measures and Techniques, Slides of Data Mining

Partial preview of the text

Download Clustering: Distance Measures and Techniques and more Slides Data Mining in PDF only on Docsity!

Clustering

Distance Measures

Hierarchical Clustering

k

-Means Algorithms

The Problem of Clustering

Given a set of points, with a notion of distance between points, group thepoints into some number of

clusters

, so

that members of a cluster are in somesense as close to each other aspossible.

Problems With Clustering

Clustering in two dimensions looks easy.

Clustering small amounts of data looks easy.

And in most cases, looks are

not

deceiving.

The Curse of Dimensionality

Many applications involve not 2, but 10 or 10,000 dimensions.

High-dimensional spaces look different: almost all pairs of points are at aboutthe same distance.



Assuming random points within a boundingbox, e.g., values between 0 and 1 in eachdimension.

Example

: Clustering CD’s

(Collaborative Filtering)

Intuitively: music divides into categories, and customers prefer a few categories.



But what are categories really?

Represent a CD by the customers who bought it.

Similar CD’s have similar sets of customers, and vice-versa.

The Space of CD’s

Think of a space with one dimension for each customer.



Values in a dimension may be 0 or 1 only.

A CD’s point in this space is (

x

1

x

2

x

k

), where

x

i

= 1 iff the

i

th

customer bought the CD.



Compare with the “correlated items”matrix: rows = customers; cols. = CD’s.

Example

: Protein Sequences

Objects are sequences of {C,A,T,G}.

Distance between sequences is

edit

distance

, the minimum number of

inserts and deletes needed to turn oneinto the other.

Note there is a “distance,” but no convenient space in which points “live.”

Distance Measures

Each clustering problem is based onsome kind of “distance” betweenpoints.

Two major classes of distancemeasure:

Euclidean

Non-Euclidean

Axioms of a Distance Measure

d

is a

distance measure

if it is a

function from pairs of points to realssuch that:

d(x,y) >

d(x,y) = 0 iff x = y.

d(x,y) = d(y,x).

d(x,y) <

d(x,z) + d(z,y) (

triangle

inequality

).

Some Euclidean Distances

L

2

norm

: d(x,y) = square root of the

sum of the squares of the differencesbetween

x

and

y

in each dimension.



The most common notion of “distance.”

L

1

norm

: sum of the differences in

each dimension.



Manhattan distance

= distance if you had

to travel along coordinates only.

Another Euclidean Distance

L

∞

norm

: d(x,y) = the maximum of

the differences between

x

and

y

in

any dimension.

Note: the maximum is the limit as

n

goes to ∞

of what you get by taking

the

n

th

power of the differences,

summing and taking the

n

th

root.

Non-Euclidean Distances

Jaccard distance

for sets = 1 minus

ratio of sizes of intersection and union.

Cosine distance

= angle between

vectors from the origin to the points inquestion.

Edit distance

= number of inserts and

deletes to change one string intoanother.

Why J.D. Is a Distance Measure

d(x,x) = 0 because x

x = x

x.

d(x,y) = d(y,x) because union and intersection are symmetric.

d(x,y) >

0 because |x

y| <

|x

y|.

d(x,y) <

d(x,z) + d(z,y) trickier --- next

slide.

Triangle Inequality for J.D.

1 - |x

z| + 1 - |y

z| >

1 - |x

y|

|x

z|

|y

z|

|x

y|

Remember: |a

b|/|a

b| = probability

that minhash(a) = minhash(b).

Thus, 1 - |a

b|/|a

b| = probability

that minhash(a)

minhash(b).