Clustering Wei Wang. Outline What is clustering Partitioning methods Hierarchical methods Density-based methods Grid-based methods Model-based clustering.

Slides:



Advertisements
Similar presentations
CLUSTERING.
Advertisements

Copyright Jiawei Han, modified by Charles Ling for CS411a
Clustering.
What is Cluster Analysis?
Clustering.
Clustering Basic Concepts and Algorithms
PARTITIONAL CLUSTERING
CS690L: Clustering References:
Data Mining Techniques: Clustering
What is Cluster Analysis?
Clustering II.
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.
Instructor: Qiang Yang
Cluster Analysis.
What is Cluster Analysis
Segmentação (Clustering) (baseado nos slides do Han)
1 Chapter 8: Clustering. 2 Searching for groups Clustering is unsupervised or undirected. Unlike classification, in clustering, no pre- classified data.
1 Partitioning Algorithms: Basic Concepts  Partition n objects into k clusters Optimize the chosen partitioning criterion Example: minimize the Squared.
Spatial and Temporal Data Mining
Cluster Analysis.
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,
Data Mining Cluster Analysis: Basic Concepts and Algorithms
Cluster Analysis Part I
Clustering Analysis of Spatial Data Using Peano Count Trees Qiang Ding William Perrizo Department of Computer Science North Dakota State University, USA.
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.
START OF DAY 8 Reading: Chap. 14. Midterm Go over questions General issues only Specific issues: visit with me Regrading may make your grade go up OR.
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
CIS664-Knowledge Discovery and Data Mining Vasileios Megalooikonomou Dept. of Computer and Information Sciences Temple University Clustering I (based on.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Clustering COMP Research Seminar BCB 713 Module Spring 2011 Wei Wang.
COMP Data Mining: Concepts, Algorithms, and Applications 1 K-means Arbitrarily choose k objects as the initial cluster centers Until no change,
Clustering I. 2 The Task Input: Collection of instances –No special class label attribute! Output: Clusters (Groups) of instances where members of a cluster.
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.
K-Means Algorithm Each cluster is represented by the mean value of the objects in the cluster Input: set of objects (n), no of clusters (k) Output:
Clustering.
Compiled By: Raj Gaurang Tiwari Assistant Professor SRMGPC, Lucknow Unsupervised Learning.
Data Mining Algorithms
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)
Clustering.
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.
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.
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 —
Clustering I Data Mining Soongsil University.
Topic 3: Cluster Analysis
©Jiawei Han and Micheline Kamber Department of Computer Science
CS 685: Special Topics in Data Mining Jinze Liu
Cluster Analysis What is Cluster Analysis?
Data Mining 資料探勘 分群分析 (Cluster Analysis) Min-Yuh Day 戴敏育
Data Mining: Clustering
CSCI N317 Computation for Scientific Applications Unit Weka
What Is Good Clustering?
Clustering Wei Wang.
Topic 5: Cluster Analysis
Presentation transcript:

Clustering Wei Wang

Outline What is clustering Partitioning methods Hierarchical methods Density-based methods Grid-based methods Model-based clustering methods Outlier analysis

What Is Clustering? Group data into clusters –Similar to one another within the same cluster –Dissimilar to the objects in other clusters –Unsupervised learning: no predefined classes Cluster 1 Cluster 2 Outliers

Application Examples A stand-alone tool: explore data distribution A preprocessing step for other algorithms Pattern recognition, spatial data analysis, image processing, market research, WWW, … –Cluster documents –Cluster web log data to discover groups of similar access patterns

What Is A Good Clustering? High intra-class similarity and low inter- class similarity –Depending on the similarity measure The ability to discover some or all of the hidden patterns

Requirements of Clustering Scalability Ability to deal with various types of attributes Discovery of clusters with arbitrary shape Minimal requirements for domain knowledge to determine input parameters

Requirements of Clustering Able to deal with noise and outliers Insensitive to order of input records High dimensionality Incorporation of user-specified constraints Interpretability and usability

Data Matrix For memory-based clustering –Also called object-by-variable structure Represents n objects with p variables (attributes, measures) –A relational table

Dissimilarity Matrix For memory-based clustering –Also called object-by-object structure –Proximities of pairs of objects –d(i,j): dissimilarity between objects i and j –Nonnegative –Close to 0: similar

How Good Is A Clustering? Dissimilarity/similarity depends on distance function –Different applications have different functions Judgment of clustering quality is typically highly subjective

Types of Data in Clustering Interval-scaled variables Binary variables Nominal, ordinal, and ratio variables Variables of mixed types

Similarity and Dissimilarity Between Objects Distances are normally used measures Minkowski distance: a generalization If q = 2, d is Euclidean distance If q = 1, d is Manhattan distance Weighed distance

Properties of Minkowski Distance Nonnegative: d(i,j)  0 The distance of an object to itself is 0 –d(i,i) = 0 Symmetric: d(i,j) = d(j,i) Triangular inequality –d(i,j)  d(i,k) + d(k,j)

Categories of Clustering Approaches (1) Partitioning algorithms –Partition the objects into k clusters –Iteratively reallocate objects to improve the clustering Hierarchy algorithms –Agglomerative: each object is a cluster, merge clusters to form larger ones –Divisive: all objects are in a cluster, split it up into smaller clusters

Categories of Clustering Approaches (2) Density-based methods –Based on connectivity and density functions –Filter out noise, find clusters of arbitrary shape Grid-based methods –Quantize the object space into a grid structure Model-based –Use a model to find the best fit of data

Partitioning Algorithms: Basic Concepts Partition n objects into k clusters –Optimize the chosen partitioning criterion Global optimal: examine all partitions –(k n -(k-1) n -…-1) possible partitions, too expensive! Heuristic methods: k-means and k-medoids –K-means: a cluster is represented by the center –K-medoids or PAM (partition around medoids): each cluster is represented by one of the objects in the cluster

K-means Arbitrarily choose k objects as the initial cluster centers Until no change, do –(Re)assign each object to the cluster to which the object is the most similar, based on the mean value of the objects in the cluster –Update the cluster means, i.e., calculate the mean value of the objects for each cluster

K-Means: Example K=2 Arbitrarily choose K object as initial cluster center Assign each objects to most similar center Update the cluster means reassign

Pros and Cons of K-means Relatively efficient: O(tkn) –n: # objects, k: # clusters, t: # iterations; k, t << n. Often terminate at a local optimum Applicable only when mean is defined –What about categorical data? Need to specify the number of clusters Unable to handle noisy data and outliers unsuitable to discover non-convex clusters

Variations of the K-means Aspects of variations –Selection of the initial k means –Dissimilarity calculations –Strategies to calculate cluster means Handling categorical data: k-modes –Use mode instead of mean Mode: the most frequent item(s) –A mixture of categorical and numerical data: k- prototype method

A Problem of K-means Sensitive to outliers –Outlier: objects with extremely large values May substantially distort the distribution of the data K-medoids: the most centrally located object in a cluster

PAM: A K-medoids Method PAM: partitioning around Medoids Arbitrarily choose k objects as the initial medoids Until no change, do –(Re)assign each object to the cluster to which the nearest medoid –Randomly select a non-medoid object o’, compute the total cost, S, of swapping medoid o with o’ –If S < 0 then swap o with o’ to form the new set of k medoids

Swapping Cost Measure whether o’ is better than o as a medoid Use the squared-error criterion –Compute E o’ -E o –Negative: swapping brings benefit

PAM: Example Total Cost = K=2 Arbitrary choose k object as initial medoids Assign each remainin g object to nearest medoids Randomly select a nonmedoid object,O ramdom Compute total cost of swapping Total Cost = 26 Swapping O and O ramdom If quality is improved. Do loop Until no change

Pros and Cons of PAM PAM is more robust than k-means in the presence of noise and outliers –Medoids are less influenced by outliers PAM is efficiently for small data sets but does not scale well for large data sets –O(k(n-k) 2 ) for each iteration Sampling based method: CLARA

CLARA (Clustering LARge Applications) CLARA (Kaufmann and Rousseeuw in 1990) –Built in statistical analysis packages, such as S+ Draw multiple samples of the data set, apply PAM on each sample, give the best clustering Perform better than PAM in larger data sets Efficiency depends on the sample size –A good clustering on samples may not be a good clustering of the whole data set

CLARANS ( Clustering Large Applications based upon RANdomized Search ) The problem space: graph of clustering –A vertex is k from n numbers, vertices in total –PAM search the whole graph –CLARA search some random sub-graphs CLARANS climbs mountains –Randomly sample a set and select k medoids –Consider neighbors of medoids as candidate for new medoids –Use the sample set to verify –Repeat multiple times to avoid bad samples