CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Slides:



Advertisements
Similar presentations
Copyright Jiawei Han, modified by Charles Ling for CS411a
Advertisements

What is Cluster Analysis?
Cluster Analysis: Basic Concepts and Algorithms
Data Mining Cluster Analysis Basics
Clustering Basic Concepts and Algorithms
PARTITIONAL CLUSTERING
CS690L: Clustering References:
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ What is Cluster Analysis? l Finding groups of objects such that the objects in a group will.
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ What is Cluster Analysis? l Finding groups of objects such that the objects in a group will.
Data Mining Cluster Analysis: Basic Concepts and Algorithms
What is Cluster Analysis?
What is Cluster Analysis? Finding groups of objects such that the objects in a group will be similar (or related) to one another and different from (or.
Data Mining Cluster Analysis: Basic Concepts and Algorithms
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
What is Cluster Analysis
Cluster Analysis: Basic Concepts and Algorithms
Cluster Analysis (1).
What is Cluster Analysis?
Cluster Analysis CS240B Lecture notes based on those by © Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004.
Data Mining Cluster Analysis: Basic Concepts and Algorithms
What is Cluster Analysis?
Clustering Ram Akella Lecture 6 February 23, & 280I University of California Berkeley Silicon Valley Center/SC.
Marcus Sampaio DSC/UFCG. Marcus Sampaio DSC/UFCG Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar Cluster Analysis: Basic.
DATA MINING LECTURE 8 Clustering The k-means algorithm
Data Mining Cluster Analysis: Basic Concepts and Algorithms
1 Lecture 10 Clustering. 2 Preview Introduction Partitioning methods Hierarchical methods Model-based methods Density-based methods.
Jeff Howbert Introduction to Machine Learning Winter Clustering Basic Concepts and Algorithms 1.
1 Motivation Web query is usually two or three words long. –Prone to ambiguity –Example “keyboard” –Input device of computer –Musical instruments How can.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Adapted from Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar.
Critical Issues with Respect to Clustering Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach, Kumar Introduction.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Clustering COMP Research Seminar BCB 713 Module Spring 2011 Wei Wang.
CLUSTERING AND SEGMENTATION MIS2502 Data Analytics Adapted from Tan, Steinbach, and Kumar (2004). Introduction to Data Mining.
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 Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar 10/30/2007.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Minqi Zhou Minqi Zhou Introduction.
Clustering.
Computational Biology Clustering Parts taken from Introduction to Data Mining by Tan, Steinbach, Kumar Lecture Slides Week 9.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Minqi Zhou © Tan,Steinbach, Kumar.
Data Mining Cluster Analysis: Basic Concepts and Algorithms.
Data Mining Algorithms
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. What is Cluster Analysis? l Finding groups of objects such that the objects in a group will be similar (or related) to one.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Data Mining: Cluster Analysis This lecture node is modified based on Lecture Notes for Chapter.
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.
Introduction to Data Mining Clustering & Classification Reference: Tan et al: Introduction to data mining. Some slides are adopted from Tan et al.
Cluster Analysis What is Cluster Analysis? Types of Data in Cluster Analysis A Categorization of Major Clustering Methods Partitioning Methods.
DATA MINING: CLUSTER ANALYSIS Instructor: Dr. Chun Yu School of Statistics Jiangxi University of Finance and Economics Fall 2015.
CSE4334/5334 Data Mining Clustering. What is Cluster Analysis? Finding groups of objects such that the objects in a group will be similar (or related)
Topic 4: Cluster Analysis Analysis of Customer Behavior and Service Modeling.
Data Mining Cluster Analysis: Basic Concepts and Algorithms.
ΠΑΝΕΠΙΣΤΗΜΙΟ ΙΩΑΝΝΙΝΩΝ ΑΝΟΙΚΤΑ ΑΚΑΔΗΜΑΪΚΑ ΜΑΘΗΜΑΤΑ Εξόρυξη Δεδομένων Ομαδοποίηση (clustering) Διδάσκων: Επίκ. Καθ. Παναγιώτης Τσαπάρας.
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: Concepts and Techniques (3rd ed.) — Chapter 10 —
Data Mining Cluster Analysis: Basic Concepts and Algorithms
Data Mining K-means Algorithm
Topic 3: Cluster Analysis
Clustering Basic Concepts and Algorithms 1
Data Mining Cluster Techniques: Basic
Critical Issues with Respect to Clustering
Clustering Wei Wang.
Topic 5: Cluster Analysis
Data Mining Cluster Analysis: Basic Concepts and Algorithms
What is Cluster Analysis?
Presentation transcript:

CEN474 Data Mining, Öğr. Gör. Esra Dinçer CLUSTER ANALYSIS Resource : Introduction to Data mining, Tan, Steinbach, Kumar Data mining, Concepts and Techniques, Han-Kamber, CEN474 Data Mining, Öğr. Gör. Esra Dinçer

What is Cluster Analysis? 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) the objects in other groups Inter-cluster distances are maximized Intra-cluster distances are minimized CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Cluster Analysis Cluster analysis is a way to examine similarities and dissimilarities of objects. Data often fall naturally into groups, or clusters, where the characteristics of objects in the same cluster are similar and the characteristics of objects in different clusters are dissimilar. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Applications of Cluster Analysis Understanding Group related documents for browsing, group genes and proteins that have similar functionality, or group stocks with similar price fluctuations Summarization Reduce the size of large data sets Clustering precipitation in Australia CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Clustering: Multidisciplinary Efforts Image Processing and Pattern Recognition Spatial Data Analysis Create thematic maps in GIS by clustering feature spaces Detect spatial clusters or for other spatial mining tasks Economic Science (especially market research) WWW Document classification Cluster Weblog data to discover groups of similar access patterns CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Clustering Applications: Some Examples 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 CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Quality: What Is Good Clustering? A good clustering method will produce high quality clusters high intra-class similarity: cohesive within clusters low inter-class similarity: distinctive between clusters The quality of a clustering result depends on both the similarity measure used by the method and its implementation The quality of a clustering method is also measured by its ability to discover some or all of the hidden patterns CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Measure the Quality of Clustering Dissimilarity/Similarity metric Similarity is expressed in terms of a distance function, typically metric: d(i, j) The definitions of distance functions are usually rather different for interval-scaled, boolean, categorical, ordinal ratio, and vector variables Weights should be associated with different variables based on applications and data semantics Quality of clustering: There is usually a separate “quality” function that measures the “goodness” of a cluster. It is hard to define “similar enough” or “good enough” The answer is typically highly subjective CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Distance Measures for Different Kinds of Data Numerical (interval)-based: Minkowski Distance: Special cases: Euclidean (L2-norm), Manhattan (L1-norm) Binary variables: symmetric vs. asymmetric (Jaccard coeff.) Nominal variables: # of mismatches Ordinal variables: treated like interval-based Ratio-scaled variables: apply log-transformation first Vectors: cosine measure Mixed variables: weighted combinations CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Major Clustering Approaches I Partitioning approach: Construct various partitions and then evaluate them by some criterion, e.g., minimizing the sum of square errors Typical methods: k-means, k-medoids, CLARANS Hierarchical approach: Create a hierarchical decomposition of the set of data (or objects) using some criterion Typical methods: Diana, Agnes, BIRCH, ROCK, CAMELEON Density-based approach: Based on connectivity and density functions Typical methods: DBSCAN, OPTICS, DenClue Grid-based approach: based on a multiple-level granularity structure Typical methods: STING, WaveCluster, CLIQUE CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Major Clustering Approaches II Model-based: A model is hypothesized for each of the clusters and tries to find the best fit of that model to each other Typical methods: EM, SOM, COBWEB Frequent pattern-based: Based on the analysis of frequent patterns Typical methods: p-Cluster User-guided or constraint-based: Clustering by considering user-specified or application-specific constraints Typical methods: COD (obstacles), constrained clustering Link-based clustering: Objects are often linked together in various ways Massive links can be used to cluster objects: SimRank, LinkClus CEN474 Data Mining, Öğr. Gör. Esra Dinçer

What is not Cluster Analysis? Supervised classification Have class label information Simple segmentation Dividing students into different registration groups alphabetically, by last name Results of a query Groupings are a result of an external specification CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Notion of a Cluster can be Ambiguous How many clusters? Six Clusters Two Clusters Four Clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Types of Clusterings A clustering is a set of clusters Important distinction between hierarchical and partitional sets of clusters Partitional Clustering A division data objects into non-overlapping subsets (clusters) such that each data object is in exactly one subset Hierarchical clustering A set of nested clusters organized as a hierarchical tree CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Partitional Clustering A Partitional Clustering Original Points CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Hierarchical Clustering Traditional Hierarchical Clustering Traditional Dendrogram Non-traditional Hierarchical Clustering Non-traditional Dendrogram CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Types of Clusters Well-separated clusters Center-based clusters Contiguous clusters Density-based clusters Property or Conceptual Described by an Objective Function CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Well-Separated Well-Separated Clusters: A cluster is a set of points such that any point in a cluster is closer (or more similar) to every other point in the cluster than to any point not in the cluster. 3 well-separated clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Center-Based A cluster is a set of objects such that an object in a cluster is closer (more similar) to the “center” of a cluster, than to the center of any other cluster The center of a cluster is often a centroid, the average of all the points in the cluster, or a medoid, the most “representative” point of a cluster 4 center-based clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Contiguity-Based Contiguous Cluster (Nearest neighbor or Transitive) A cluster is a set of points such that a point in a cluster is closer (or more similar) to one or more other points in the cluster than to any point not in the cluster. 8 contiguous clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Density-Based A cluster is a dense region of points, which is separated by low-density regions, from other regions of high density. Used when the clusters are irregular or intertwined, and when noise and outliers are present. 6 density-based clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Conceptual Clusters Shared Property or Conceptual Clusters Finds clusters that share some common property or represent a particular concept. . 2 Overlapping Circles CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Objective Function Clusters Defined by an Objective Function Finds clusters that minimize or maximize an objective function. Enumerate all possible ways of dividing the points into clusters and evaluate the `goodness' of each potential set of clusters by using the given objective function. (NP Hard) Can have global or local objectives. Hierarchical clustering algorithms typically have local objectives Partitional algorithms typically have global objectives A variation of the global objective function approach is to fit the data to a parameterized model. Parameters for the model are determined from the data. Mixture models assume that the data is a ‘mixture' of a number of statistical distributions. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Types of Clusters: Objective Function Map the clustering problem to a different domain and solve a related problem in that domain Proximity matrix defines a weighted graph, where the nodes are the points being clustered, and the weighted edges represent the proximities between points Clustering is equivalent to breaking the graph into connected components, one for each cluster. Want to minimize the edge weight between clusters and maximize the edge weight within clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Characteristics of the Input Data Are Important Type of proximity or density measure This is a derived measure, but central to clustering Sparseness Dictates type of similarity Adds to efficiency Attribute type Type of Data Other characteristics, e.g., autocorrelation Dimensionality Noise and Outliers Type of Distribution CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Clustering Algorithms K-means and its variants Hierarchical clustering Density-based clustering CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer K-means Clustering Partitional clustering approach Each cluster is associated with a centroid (center point) Each point is assigned to the cluster with the closest centroid Number of clusters, K, must be specified The basic algorithm is very simple CEN474 Data Mining, Öğr. Gör. Esra Dinçer

The K-Means Clustering Method Example CEN474 Data Mining, Öğr. Gör. Esra Dinçer

The K-Means Clustering Method Example CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer

K-means Clustering – Details Initial centroids are often chosen randomly. Clusters produced vary from one run to another. The centroid is (typically) the mean of the points in the cluster. ‘Closeness’ is measured by Euclidean distance, cosine similarity, correlation, etc. K-means will converge for common similarity measures mentioned above. Most of the convergence happens in the first few iterations. Often the stopping condition is changed to ‘Until relatively few points change clusters’ Complexity is O( n * K * I * d ) n = number of points, K = number of clusters, I = number of iterations, d = number of attributes CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Evaluating K-means Clusters Most common measure is Sum of Squared Error (SSE) For each point, the error is the distance to the nearest cluster To get SSE, we square these errors and sum them. x is a data point in cluster Ci and mi is the representative point for cluster Ci can show that mi corresponds to the center (mean) of the cluster Given two clusters, we can choose the one with the smallest error One easy way to reduce SSE is to increase K, the number of clusters A good clustering with smaller K can have a lower SSE than a poor clustering with higher K CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Importance of Choosing Initial Centroids CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Importance of Choosing Initial Centroids CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Importance of Choosing Initial Centroids CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Importance of Choosing Initial Centroids CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer 10 Clusters Example Starting with two initial centroids in one cluster of each pair of clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer 10 Clusters Example Starting with two initial centroids in one cluster of each pair of clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer 10 Clusters Example Starting with some pairs of clusters having three initial centroids, while other have only one. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer 10 Clusters Example Starting with some pairs of clusters having three initial centroids, while other have only one. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Solutions to Initial Centroids Problem Multiple runs Helps, but probability is not on your side Sample and use hierarchical clustering to determine initial centroids Select more than k initial centroids and then select among these initial centroids Select most widely separated Postprocessing Bisecting K-means Not as susceptible to initialization issues CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Handling Empty Clusters Basic K-means algorithm can yield empty clusters Several strategies Choose the point that contributes most to SSE Choose a point from the cluster with the highest SSE If there are several empty clusters, the above can be repeated several times. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Updating Centers Incrementally In the basic K-means algorithm, centroids are updated after all points are assigned to a centroid An alternative is to update the centroids after each assignment (incremental approach) Each assignment updates zero or two centroids More expensive Introduces an order dependency Never get an empty cluster Can use “weights” to change the impact CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Pre-processing and Post-processing Normalize the data Eliminate outliers Post-processing Eliminate small clusters that may represent outliers Split ‘loose’ clusters, i.e., clusters with relatively high SSE Merge clusters that are ‘close’ and that have relatively low SSE Can use these steps during the clustering process ISODATA CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Limitations of K-means K-means has problems when clusters are of differing Sizes Densities Non-globular shapes K-means has problems when the data contains outliers. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Limitations of K-means: Differing Sizes Original Points K-means (3 Clusters) CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Limitations of K-means: Differing Density Original Points K-means (3 Clusters) CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Limitations of K-means: Non-globular Shapes Original Points K-means (2 Clusters) CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Overcoming K-means Limitations Original Points K-means Clusters One solution is to use many clusters. Find parts of clusters, but need to put together. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Overcoming K-means Limitations Original Points K-means Clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Overcoming K-means Limitations Original Points K-means Clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

K-means application using Matlab CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Remember the dispersion of sepal lengths CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Code for the dispersion % sepal lengths of the three flowers plot(meas(1:50,1),' b+') hold on; plot(meas(51:100,1),' g*') plot(meas(101:150,1),' rx') xlabel('Count'); ylabel('Length'); title('Sepal lengths of the three flowers'); CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer K-means in Matlab IDX = KMEANS(X, K) partitions the points in the N-by-P data matrix X into K clusters. This partition minimizes the sum, over all clusters, of the within-cluster sums of point-to-cluster-centroid distances. Rows of X correspond to points, columns correspond to variables. KMEANS returns an N-by-1 vector IDX containing the cluster indices of each point. By default, KMEANS uses squared Euclidean distances. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Displaying Clusters in Matlab SILHOUETTE Silhouette plot for clustered data. SILHOUETTE(X, CLUST) silhouettes for the X matrix N-by-P data, CLUST defined clusters. S = SILHOUETTE(X, CLUST) returns the silhouette values in the N-by-1 vector S. The silhouette value for each point is a measure of how similar that point is to points in its own cluster vs. points in other clusters, and ranges from -1 to +1. CEN474 Data Mining, Öğr. Gör. Esra Dinçer

Clustering the sepal lengths figure idx=kmeans(meas(:,1),2); silhouette(meas(:,1),idx) idx=kmeans(meas(:,1),3); idx=kmeans(meas(:,1),4); CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Example File  new  Variable  array editor Write these numbers and partition these points into 2 clusters CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Result CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Example Try to partition these points into 3 clusters. Change 35 to 40 and try again CEN474 Data Mining, Öğr. Gör. Esra Dinçer

CEN474 Data Mining, Öğr. Gör. Esra Dinçer Result CEN474 Data Mining, Öğr. Gör. Esra Dinçer