Docsity

Minhashing-Data Mining-Lecture 04 Slides-Computer Science, Slides of Data Mining

Partial preview of the text

Download Minhashing-Data Mining-Lecture 04 Slides-Computer Science and more Slides Data Mining in PDF only on Docsity!

Low-Support, High-Correlation

Finding Rare but Similar Items

Minhashing

Locality-Sensitive Hashing

The Problem

Rather than finding high-support item-pairs in basket data, look for items thatare highly “correlated.”^ ^

If one appears in a basket, there is a goodchance that the other does.  “Yachts and caviar” as itemsets: lowsupport, but often appear together.

Matrix Representation of

Item/Basket Data

Columns

= items.

Rows

= baskets.

Entry (

r^ ,

c^

) = 1 if item

c^

is in basket

r^ ; = 0 if not.

Assume matrix is almost all 0’s.

In Matrix Form

m^

c^

p^

b^

j

{m,c,b}

{m,p,b}

{m,b}

{c,j}

{m,p,j}

{m,c,b,j}

{c,b,j}

{c,b}

Applications --- (2)

Rows = (footprints of) shingles;columns = documents.^ ^

(^ r, c

) = 1 iff footprint

r^

is present in

document

c.

^ Find similar documents, as in Anand’s10/10 lecture.

Applications --- (3)

Rows and columns are both Webpages.^ ^

(^ r, c

) = 1 iff page

r^

links to page

c.

^ Correlated columns are pages with many ofthe same in-links. ^ These pages may be about the same topic.

Assumptions --- (2)

Too many baskets to store anything inmain memory for each basket.

Data is very sparse: it is rare for anitem to be in a basket.

From Correlation to Similarity Statistical correlation is too hard tocompute, and probably meaningless.^ 

Most entries are 0, so correlation ofcolumns is always high.

Substitute “similarity,” as in shingles-and-documents study.

Example

C^1

C

2

Sim (C

, C 1

Outline of Algorithm

Compute “signatures” (“sketches”) ofcolumns = small summaries of columns.^ 

Read from disk to main memory.

Examine signatures in main memory tofind similar signatures.^ 

Essential: similarity of signatures andcolumns are related.

Check that columns with similarsignatures are really similar (optional).

An Idea That Doesn’t Work

Pick 100 rows at random, and let thesignature of column

C^

be the 100 bits

of

C^

in those rows.

Because the matrix is sparse, manycolumns would have 00.. .0 as asignature, yet be very dissimilarbecause their 1’s are in different rows.

Four Types of Rows

Given columns C

and C 1

, rows may be 2

classified as:

C^1

C^2

a^

1

1

b^

1

0

c^

0

1

d^

0

0

Also,

a^

= # rows of type

a^ , etc.

Note

Sim

(C

, C 1

a^ /(

a^ +

b^

+^ c

19

Minhashing Example

Input matrix

Signature matrix

M 1 2 1 2

Surprising Property

The probability (over all permutations of therows) that

h^ (C

h^ (C

) is the same as 2

Sim

(C

, C 1

Both are

a^ /(

a^ +

b^ +

c^ )!

Why?^ ^

Look down columns C

and C 1

until we see a 1. 2

^ If it’s a type

a^

row, then

h^ (C

) = 1

h^ (C

). 2 If a

type

b^

or

c^

row, then not.