Docsity

Data Mining - Lecture Slides - Data Base Management Systems | CMSC 724, Study notes of Database Management Systems (DBMS)

Partial preview of the text

Download Data Mining - Lecture Slides - Data Base Management Systems | CMSC 724 and more Study notes Database Management Systems (DBMS) in PDF only on Docsity!

CMSC 724: Data Mining

Amol Deshpande

University of Maryland, College Park

March 24, 2009

Outline

1 Overview

2 Association Rules

3 Clustering

4 Classification

Naive Bayes Classifier

5 Data Mining + Query Evaluation

Outline

1 Overview

2 Association Rules

3 Clustering

4 Classification

Naive Bayes Classifier

5 Data Mining + Query Evaluation

Association Rules

Consider “market basket” data

Each “transaction” contains the list of “items” bought by a customer in one visit Not normalized (transactions contain diff no. of items) Example: (customer1, “2/2/2 5pm”, “milk”, “bread”, ...) (customer2, “2/3/2 5:10pm”, “milk”, “coffee”, ...)

Association Rule Mining

Goal:

Find all association rules with at least a given confidence (say 90%) and a given support (say 5%)

Association Rule Mining

Goal:

Find all association rules with at least a given confidence (say 90%) and a given support (say 5%)

Fast Algorithms for Mining Association Rules; Rakesh

Agrawal and Ramakrishnan Srikant; VLDB 2004

Presented an algorithm called “Apriori” For finding the itemsets with the specified support Probably the first “scalable” data mining paper One of the highest cited papers in all of CS Came out of Database literature, not Machine Learning

Basic Apriori Algorithm

Say the required support is 5%

Observation: A set X cannot have sufficient support if

Y ⊂ X doesn’t have sufficient support

Algorithm:

  1. Start by counting all items that occur in 5% transactions (say {I 1 }, {I 2 }, {I 3 })
  2. Generate a set of candidates for the next step by combining the above itemsets ({I 1 , I 2 }, {I 1 , I 3 }, {I 2 , I 3 })
  3. Make another pass and check if the candidate itemsets appear in 5% transactions (say {I 1 , I 2 }, {I 1 , I 3 } appear)
  4. Repeat steps 2 and 3. (In the example, there are no more candidate sets. {I 1 , I 2 , I 3 } cannot occur in 5% transactions, because {I 2 , I 3 } doesn’t).

Association Rule Mining

Basic Apriori Algorithm:

Step 2 done using SQL queries and self-joins Essentially a self-join between the itemsets found at previous step Number of joins limited (and size of the relations decreases) More efficient algorithms presented in the paper

Outline

1 Overview

2 Association Rules

3 Clustering

4 Classification

Naive Bayes Classifier

5 Data Mining + Query Evaluation

Clustering

Given a set of tuples and k, group them into k “clusters”

So that some distance metric is minimized

Unsupervised: You are only given k

Cluster IDs have no intrinsic meaning (though one can

be provided later)

Commonly used distance metrics:

For numerical data: Euclidean distance, Manhatten distance, L∞ distance For categorical data: Map to reals

Clustering

k-means vs k-center vs k-median

k-means: The center of a cluster is the “mean” of the points assigned to it May not be a real point

Clustering

k-means vs k-center vs k-median

k-means: The center of a cluster is the “mean” of the points assigned to it May not be a real point k-center and k-median: The cluster centers must be chosen from the points to be clustered k-center: minimizes the largest distance between a point and its cluster head k-median: minimizes the sum of distances between points and their cluster heads

Clustering

“k-means” algorithm

At any point, have k “centroids”, one for each cluster Initially, choose k of the points randomly to be centroids Assign each point in the dataset to the closest cluster centroid Recompute the cluster centroids to be the “means” of the points assigned to that cluster Repeat till convergence

Clustering

“k-means” algorithm

At any point, have k “centroids”, one for each cluster Initially, choose k of the points randomly to be centroids Assign each point in the dataset to the closest cluster centroid Recompute the cluster centroids to be the “means” of the points assigned to that cluster Repeat till convergence

Guaranteed to converge, usually within a few iterations

Not optimal, finds a local minima (there are too many

local minimas in the solution space)

Also somewhat sensitive to the initial choice of centrois

EM Algorithm: Expectation-Maximization Algorithm