Data Mining Algorithms

Slides:



Advertisements
Similar presentations
CLUSTERING.
Advertisements

Copyright Jiawei Han, modified by Charles Ling for CS411a
Clustering Clustering of data is a method by which large sets of data is grouped into clusters of smaller sets of similar data. The example below demonstrates.
What is Cluster Analysis?
Clustering.
Clustering Basic Concepts and Algorithms
CS690L: Clustering References:
Data Mining Techniques: Clustering
Clustering II.
Clustering (slide from Han and Kamber)
Clustering.
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
Clustering II.
Slide 1 EE3J2 Data Mining Lecture 16 Unsupervised Learning Ali Al-Shahib.
Cluster Analysis.
What is Cluster Analysis
Segmentação (Clustering) (baseado nos slides do Han)
Clustering. 2 Outline  Introduction  K-means clustering  Hierarchical clustering: COBWEB.
1 Chapter 8: Clustering. 2 Searching for groups Clustering is unsupervised or undirected. Unlike classification, in clustering, no pre- classified data.
Clustering. 2 Outline  Introduction  K-means clustering  Hierarchical clustering: COBWEB.
1 Partitioning Algorithms: Basic Concepts  Partition n objects into k clusters Optimize the chosen partitioning criterion Example: minimize the Squared.
Ranking by Odds Ratio A Probability Model Approach let be a Boolean random variable: document d is relevant to query q otherwise Consider document d as.
Cluster Analysis.
What is Cluster Analysis?
UIC - CS 5941 Chapter 5: Clustering. UIC - CS 5942 Searching for groups Clustering is unsupervised or undirected. Unlike classification, in clustering,
Unsupervised Learning. CS583, Bing Liu, UIC 2 Supervised learning vs. unsupervised learning Supervised learning: discover patterns in the data that relate.
Data Mining Cluster Analysis: Basic Concepts and Algorithms
Cluster Analysis Part I
Advanced Database Technologies
Cluster Analysis Part II. Learning Objectives Hierarchical Methods Density-Based Methods Grid-Based Methods Model-Based Clustering Methods Outlier Analysis.
11/15/2012ISC471 / HCI571 Isabelle Bichindaritz 1 Clustering.
1 Lecture 10 Clustering. 2 Preview Introduction Partitioning methods Hierarchical methods Model-based methods Density-based methods.
1 Motivation Web query is usually two or three words long. –Prone to ambiguity –Example “keyboard” –Input device of computer –Musical instruments How can.
October 27, 2015Data Mining: Concepts and Techniques1 Data Mining: Concepts and Techniques — Slides for Textbook — — Chapter 7 — ©Jiawei Han and Micheline.
1 Clustering Sunita Sarawagi
CLUSTERING. Overview Definition of Clustering Existing clustering methods Clustering examples.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Clustering COMP Research Seminar BCB 713 Module Spring 2011 Wei Wang.
Clustering.
Cluster Analysis Potyó László. Cluster: a collection of data objects Similar to one another within the same cluster Similar to one another within the.
DATA MINING WITH CLUSTERING AND CLASSIFICATION Spring 2007, SJSU Benjamin Lam.
Clustering. 2 Outline  Introduction  K-means clustering  Hierarchical clustering: COBWEB.
Clustering.
Compiled By: Raj Gaurang Tiwari Assistant Professor SRMGPC, Lucknow Unsupervised Learning.
CS685 : Special Topics in Data Mining, UKY The UNIVERSITY of KENTUCKY Clustering Analysis CS 685: Special Topics in Data Mining Jinze Liu.
Definition Finding groups of objects such that the objects in a group will be similar (or related) to one another and different from (or unrelated to)
Cluster Analysis Dr. Bernard Chen Assistant Professor Department of Computer Science University of Central Arkansas.
Mr. Idrissa Y. H. Assistant Lecturer, Geography & Environment Department of Social Sciences School of Natural & Social Sciences State University of Zanzibar.
Cluster Analysis Dr. Bernard Chen Ph.D. Assistant Professor Department of Computer Science University of Central Arkansas Fall 2010.
Clustering Wei Wang. Outline What is clustering Partitioning methods Hierarchical methods Density-based methods Grid-based methods Model-based clustering.
1 Similarity and Dissimilarity Between Objects Distances are normally used to measure the similarity or dissimilarity between two data objects Some popular.
Data Mining Lecture 7. Course Syllabus Clustering Techniques (Week 6) –K-Means Clustering –Other Clustering Techniques.
Cluster Analysis What is Cluster Analysis? Types of Data in Cluster Analysis A Categorization of Major Clustering Methods Partitioning Methods.
1 Cluster Analysis What is Cluster Analysis? Types of Data in Cluster Analysis A Categorization of Major Clustering Methods Partitioning Methods Density-Based.
CLUSTER ANALYSIS. Cluster Analysis  Cluster analysis is a major technique for classifying a ‘mountain’ of information into manageable meaningful piles.
Topic 4: Cluster Analysis Analysis of Customer Behavior and Service Modeling.
Cluster Analysis This work is created by Dr. Anamika Bhargava, Ms. Pooja Kaul, Ms. Priti Bali and Ms. Rajnipriya Dhawan and licensed under a Creative Commons.
Data Mining Comp. Sc. and Inf. Mgmt. Asian Institute of Technology
What Is Cluster Analysis?
Data Mining: Concepts and Techniques (3rd ed.) — Chapter 10 —
Topic 3: Cluster Analysis
©Jiawei Han and Micheline Kamber Department of Computer Science
Clustering.
Data Mining 資料探勘 分群分析 (Cluster Analysis) Min-Yuh Day 戴敏育
DATA MINING Introductory and Advanced Topics Part II - Clustering
Data Mining: Clustering
CSCI N317 Computation for Scientific Applications Unit Weka
Clustering Wei Wang.
Text Categorization Berlin Chen 2003 Reference:
Topic 5: Cluster Analysis
Presentation transcript:

Data Mining Algorithms Clustering

M.Vijayalakshmi VESIT BE(IT) Data Mining Clustering Outline Goal: Provide an overview of the clustering problem and introduce some of the basic algorithms Clustering Problem Overview Clustering Techniques Hierarchical Algorithms Partitional Algorithms Genetic Algorithm Clustering Large Databases M.Vijayalakshmi VESIT BE(IT) Data Mining

What is Cluster Analysis? Cluster: a collection of data objects Similar to one another within the same cluster Dissimilar to the objects in other clusters Cluster analysis Grouping a set of data objects into clusters Clustering is unsupervised classification: no predefined classes Typical applications As a stand-alone tool to get insight into data distribution As a preprocessing step for other algorithms M.Vijayalakshmi VESIT BE(IT) Data Mining

General Applications of Clustering Pattern Recognition Spatial Data Analysis create thematic maps in GIS by clustering feature spaces detect spatial clusters and explain them in spatial data mining Image Processing Economic Science (especially market research) WWW Document classification Cluster Weblog data to discover groups of similar access patterns M.Vijayalakshmi VESIT BE(IT) Data Mining

Examples of Clustering Applications Marketing: Help marketers discover distinct groups in their customer bases, and then use this knowledge to develop targeted marketing programs Land use: Identification of areas of similar land use in an earth observation database Insurance: Identifying groups of motor insurance policy holders with a high average claim cost City-planning: Identifying groups of houses according to their house type, value, and geographical location Earth-quake studies: Observed earth quake epicenters should be clustered along continent faults M.Vijayalakshmi VESIT BE(IT) Data Mining

Clustering vs. Classification No prior knowledge Number of clusters Meaning of clusters Cluster results are dynamic Unsupervised learning M.Vijayalakshmi VESIT BE(IT) Data Mining

Classification vs. Clustering Classification: Supervised learning: Learns a method for predicting the instance class from pre-labeled (classified) instances M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Clustering Unsupervised learning: Finds “natural” grouping of instances given un-labeled data M.Vijayalakshmi VESIT BE(IT) Data Mining

Clustering Houses Geographic Distance Based Size Based M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Clustering Methods Many different method and algorithms: For numeric and/or symbolic data Deterministic vs. probabilistic Exclusive vs. overlapping Hierarchical vs. flat Top-down vs. bottom-up M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Clustering Issues Outlier handling Dynamic data Interpreting results Evaluating results Number of clusters Data to be used Scalability M.Vijayalakshmi VESIT BE(IT) Data Mining

Impact of Outliers on Clustering M.Vijayalakshmi VESIT BE(IT) Data Mining

Clustering Evaluation Manual inspection Benchmarking on existing labels Cluster quality measures distance measures high similarity within a cluster, low across clusters M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Data Structures Data matrix Dissimilarity matrix M.Vijayalakshmi VESIT BE(IT) Data Mining

Measure the Quality of Clustering Dissimilarity/Similarity metric: Similarity is expressed in terms of a distance function, which is typically metric: d(i, j) There is a separate “quality” function that measures the “goodness” of a cluster. The definitions of distance functions are usually very different for interval-scaled, boolean, categorical, ordinal and ratio variables. Weights should be associated with different variables based on applications and data semantics. It is hard to define “similar enough” or “good enough” the answer is typically highly subjective. M.Vijayalakshmi VESIT BE(IT) Data Mining

Type of data in clustering analysis Interval-scaled variables: Binary variables: Nominal, ordinal, and ratio variables: Variables of mixed types: M.Vijayalakshmi VESIT BE(IT) Data Mining

Similarity and Dissimilarity Between Objects Distances are normally used to measure the similarity or dissimilarity between two data objects Some popular ones include: Minkowski distance: where i = (xi1, xi2, …, xip) and j = (xj1, xj2, …, xjp) are two p-dimensional data objects, and q is a positive integer If q = 1, d is Manhattan distance M.Vijayalakshmi VESIT BE(IT) Data Mining

Similarity and Dissimilarity Between Objects (Cont.) If q = 2, d is Euclidean distance: Properties d(i,j)  0 d(i,i) = 0 d(i,j) = d(j,i) d(i,j)  d(i,k) + d(k,j) M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Binary Variables A contingency table for binary data Simple matching coefficient (invariant, if the binary variable is symmetric): Jaccard coefficient (noninvariant if the binary variable is asymmetric): Object j Object i M.Vijayalakshmi VESIT BE(IT) Data Mining

Dissimilarity between Binary Variables Example gender is a symmetric attribute the remaining attributes are asymmetric binary let the values Y and P be set to 1, and the value N be set to 0 M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Nominal Variables A generalization of the binary variable in that it can take more than 2 states, e.g., red, yellow, blue, green Method 1: Simple matching m: # of matches, p: total # of variables Method 2: use a large number of binary variables creating a new binary variable for each of the M nominal states M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Clustering Problem Given a database D={t1,t2,…,tn} of tuples and an integer value k, the Clustering Problem is to define a mapping f:Dg{1,..,k} where each ti is assigned to one cluster Kj, 1<=j<=k. A Cluster, Kj, contains precisely those tuples mapped to it. Unlike classification problem, clusters are not known a priori. M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Types of Clustering Hierarchical – Nested set of clusters created. Partitional – One set of clusters created. Incremental – Each element handled one at a time. Simultaneous – All elements handled together. Overlapping/Non-overlapping M.Vijayalakshmi VESIT BE(IT) Data Mining

Major Clustering Approaches Partitioning algorithms: Construct various partitions and then evaluate them by some criterion Hierarchy algorithms: Create a hierarchical decomposition of the set of data (or objects) using some criterion Density-based: based on connectivity and density functions Grid-based: based on a multiple-level granularity structure Model-based: A model is hypothesized for each of the clusters and the idea is to find the best fit of that model to each other M.Vijayalakshmi VESIT BE(IT) Data Mining

Clustering Approaches Hierarchical Partitional Categorical Large DB Agglomerative Divisive Sampling Compression M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Cluster Parameters M.Vijayalakshmi VESIT BE(IT) Data Mining

Distance Between Clusters Single Link: smallest distance between points Complete Link: largest distance between points Average Link: average distance between points Centroid: distance between centroids M.Vijayalakshmi VESIT BE(IT) Data Mining

Hierarchical Clustering Clusters are created in levels actually creating sets of clusters at each level. Agglomerative Initially each item in its own cluster Iteratively clusters are merged together Bottom Up Divisive Initially all items in one cluster Large clusters are successively divided Top Down M.Vijayalakshmi VESIT BE(IT) Data Mining

Hierarchical Clustering Use distance matrix as clustering criteria. This method does not require the number of clusters k as an input, but needs a termination condition Step 0 Step 1 Step 2 Step 3 Step 4 b d c e a a b d e c d e a b c d e agglomerative (AGNES) divisive (DIANA) M.Vijayalakshmi VESIT BE(IT) Data Mining

Hierarchical Algorithms Single Link MST Single Link Complete Link Average Link M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Dendrogram A tree data structure which illustrates hierarchical clustering techniques. Each level shows clusters for that level. Leaf – individual clusters Root – one cluster A cluster at level i is the union of its children clusters at level i+1. M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Levels of Clustering M.Vijayalakshmi VESIT BE(IT) Data Mining

Agglomerative Example B C D E 1 2 3 4 5 A B E C D Threshold of 1 2 3 4 5 A B C D E M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining MST Example A B A B C D E 1 2 3 4 5 E C D M.Vijayalakshmi VESIT BE(IT) Data Mining

Agglomerative Algorithm M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Single Link View all items with links (distances) between them. Finds maximal connected components in this graph. Two clusters are merged if there is at least one edge which connects them. Uses threshold distances at each level. Could be agglomerative or divisive. M.Vijayalakshmi VESIT BE(IT) Data Mining

MST Single Link Algorithm M.Vijayalakshmi VESIT BE(IT) Data Mining

Single Link Clustering M.Vijayalakshmi VESIT BE(IT) Data Mining

AGNES (Agglomerative Nesting) Implemented in statistical analysis packages, e.g., Splus Use the Single-Link method and the dissimilarity matrix. Merge nodes that have the least dissimilarity Go on in a non-descending fashion Eventually all nodes belong to the same cluster M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining A Dendrogram Shows How the Clusters are Merged Hierarchically Decompose data objects into a several levels of nested partitioning (tree of clusters), called a dendrogram. A clustering of the data objects is obtained by cutting the dendrogram at the desired level, then each connected component forms a cluster. M.Vijayalakshmi VESIT BE(IT) Data Mining

DIANA (Divisive Analysis) Implemented in statistical analysis packages, e.g., Splus Inverse order of AGNES Eventually each node forms a cluster on its own M.Vijayalakshmi VESIT BE(IT) Data Mining

Partitional Clustering Nonhierarchical Creates clusters in one step as opposed to several steps. Since only one set of clusters is output, the user normally has to input the desired number of clusters, k. Usually deals with static sets. M.Vijayalakshmi VESIT BE(IT) Data Mining

Partitioning Algorithms Partitioning method: Construct a partition of a database D of n objects into a set of k clusters Given a k, find a partition of k clusters that optimizes the chosen partitioning criterion Global optimal: exhaustively enumerate all partitions Heuristic methods: k-means and k-medoids algorithms k-means: Each cluster is represented by the center of the cluster k-medoids or PAM (Partition around medoids): Each cluster is represented by one of the objects in the cluster M.Vijayalakshmi VESIT BE(IT) Data Mining

Partitional Algorithms MST Squared Error K-Means Nearest Neighbor PAM BEA GA M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining MST Algorithm M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining K-Means Initial set of clusters randomly chosen. Iteratively, items are moved among sets of clusters until the desired set is reached. High degree of similarity among elements in a cluster is obtained. Given a cluster Ki={ti1,ti2,…,tim}, the cluster mean is mi = (1/m)(ti1 + … + tim) M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining K-Means Example Given: {2,4,10,12,3,20,30,11,25}, k=2 Randomly assign means: m1=3,m2=4 K1={2,3}, K2={4,10,12,20,30,11,25}, m1=2.5,m2=16 K1={2,3,4},K2={10,12,20,30,11,25}, m1=3,m2=18 K1={2,3,4,10},K2={12,20,30,11,25}, m1=4.75,m2=19.6 K1={2,3,4,10,11,12},K2={20,30,25}, m1=7,m2=25 Stop as the clusters with these means are the same. M.Vijayalakshmi VESIT BE(IT) Data Mining

The K-Means Clustering Method Given k, the k-means algorithm is implemented in 4 steps: Partition objects into k nonempty subsets Compute seed points as the centroids of the clusters of the current partition. The centroid is the center (mean point) of the cluster. Assign each object to the cluster with the nearest seed point. Go back to Step 2, stop when no more new assignment. M.Vijayalakshmi VESIT BE(IT) Data Mining

Comments on the K-Means Method Strength Relatively efficient: O(tkn), where n is # objects, k is # clusters, and t is # iterations. Normally, k, t << n. Often terminates at a local optimum. The global optimum may be found using techniques such as: deterministic annealing and genetic algorithms Weakness Applicable only when mean is defined, then what about categorical data? Need to specify k, the number of clusters, in advance Unable to handle noisy data and outliers Not suitable to discover clusters with non-convex shapes M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Nearest Neighbor Items are iteratively merged into the existing clusters that are closest. Incremental Threshold, t, used to determine if items are added to existing clusters or a new cluster is created. M.Vijayalakshmi VESIT BE(IT) Data Mining

Variations of the K-Means Method A few variants of the k-means which differ in Selection of the initial k means Dissimilarity calculations Strategies to calculate cluster means Handling categorical data: k-modes Replacing means of clusters with modes Using new dissimilarity measures to deal with categorical objects Using a frequency-based method to update modes of clusters A mixture of categorical and numerical data: k-prototype method M.Vijayalakshmi VESIT BE(IT) Data Mining

The K-Medoids Clustering Method Find representative objects, called medoids, in clusters PAM (Partitioning Around Medoids,) starts from an initial set of medoids and iteratively replaces one of the medoids by one of the non-medoids if it improves the total distance of the resulting clustering PAM works effectively for small data sets, but does not scale well for large data sets CLARA CLARANS): Randomized sampling Focusing + spatial data structure M.Vijayalakshmi VESIT BE(IT) Data Mining

PAM (Partitioning Around Medoids) PAM - Use real object to represent the cluster Select k representative objects arbitrarily For each pair of non-selected object h and selected object i, calculate the total swapping cost TCih For each pair of i and h, If TCih < 0, i is replaced by h Then assign each non-selected object to the most similar representative object repeat steps 2-3 until there is no change M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining PAM Partitioning Around Medoids (PAM) (K-Medoids) Handles outliers well. Ordering of input does not impact results. Does not scale well. Each cluster represented by one item, called the medoid. Initial set of k medoids randomly chosen. M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining PAM M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining PAM Algorithm M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining DBSCAN Density Based Spatial Clustering of Applications with Noise Outliers will not effect creation of cluster. Input MinPts – minimum number of points in cluster Eps – for each point in cluster there must be another point in it less than this distance away. M.Vijayalakshmi VESIT BE(IT) Data Mining

M.Vijayalakshmi VESIT BE(IT) Data Mining Density Concepts M.Vijayalakshmi VESIT BE(IT) Data Mining

Comparison of Clustering Techniques M.Vijayalakshmi VESIT BE(IT) Data Mining