SlideShare une entreprise Scribd logo
1  sur  35
Presented by: Derek Kane
 Introduction to Clustering Techniques
 K-Means
 Hierarchical Clustering
 Gaussian Mixed Model
 Visualization of Distance Matrix
 Practical Example
 Cluster analysis or clustering is the task of
grouping a set of objects in such a way that
objects in the same group (called a cluster)
are more similar (in some sense or another)
to each other than to those in other groups
(clusters).
 It is a main task of exploratory data mining,
and a common technique for statistical data
analysis, used in many fields, including
machine learning, pattern recognition, image
analysis, information retrieval, and
bioinformatics.
 Cluster analysis itself is not one specific
algorithm, but the general task to be solved.
There are many real world applications of clustering:
 Grouping or Hierarchies of Products
 Recommendation Engines
 Biological Classification
 Typologies
 Crime Analysis
 Medical Imaging
 Market Research
 Social Network Analysis
 Markov Chain Monte Carlo Methods
 According to Vladimir Estivill-Castro, the notion
of a "cluster" cannot be precisely defined, which
is one of the reasons why there are so many
clustering algorithms.
 There is no objectively "correct" clustering
algorithm, but as it was noted, "clustering is in
the eye of the beholder.“
There are many different types of clustering
models including:
 Connectivity models
 Centroid models
 Distribution models
 Density models
 Group models
 Graph-based models
 A "clustering" is essentially a set of such
clusters, usually containing all objects in the
data set.
 Additionally, it may specify the relationship of
the clusters to each other, for example a
hierarchy of clusters embedded in each other.
Clusterings can be roughly distinguished as:
 hard clustering: each object belongs to a
cluster or not.
 soft clustering (also: fuzzy clustering): each
object belongs to each cluster to a certain
degree (e.g. a likelihood of belonging to the
cluster).
 K-means is one of the simplest unsupervised
learning algorithms that solve the well known
clustering problem.
The algorithm is composed of the following steps:
 Place K points into the space represented by
the objects that are being clustered. These
points represent initial group centroids.
 Assign each object to the group that has the
closest centroid.
 When all objects have been assigned,
recalculate the positions of the K centroids.
 Repeat Steps 2 and 3 until the centroids no
longer move.
 The k-means algorithm does not necessarily find
the most optimal configuration, corresponding
to the global objective function minimum.
 The algorithm is also significantly sensitive to the
initial randomly selected cluster centers.
 A scree plot is a graphical display of the
variance of each (cluster) component in
the dataset which is used to determine
how many components should be
retained in order to explain a high
percentage of the variation in the data.
 The variance of each component is
calculated using the following formula:
λi∑i=1nλi where λi is the ith eigenvalue
and ∑i=1nλi is the sum of all of the
eigenvalues.
 The plot shows the variance for the first
component and then for the subsequent
components, it shows the additional
variance that each component is adding.
 A scree plot is sometimes referred to as an “elbow” plot.
 In order to identify the optimal number of clusters for further analysis, we need to look
for the “bend” in the graph at the elbow.
# of Clusters should be 3 or 4
 Silhouette refers to a method of interpretation and validation of clusters of data.
 The silhouette technique provides a succinct graphical representation of how well each object
lies within its cluster and was first described by Peter J. Rousseeuw in 1986.
 The goal of a silhouette plot is to identify the point of the highest Average Silhouette
Width (ASW). This is the optimal number of clusters for the analysis.
Cluster = 4
 The Cluster plot shows the spread of the data within each of the generated clusters.
 A Principal Component Analysis (greater than 2 dimensions) can be utilized to view the clustering.
 Here is an example of K-Means clustering based on the Ruspini data.
Cluster = 4
 Hierarchical clustering (or hierarchic
clustering ) outputs a hierarchy, a
structure that is more informative than
the unstructured set of clusters returned
by flat clustering.
 Hierarchical clustering does not require
us to prespecify the number of clusters
and most hierarchical algorithms that
have been used in IR are deterministic.
 These advantages of hierarchical
clustering come at the cost of lower
efficiency.
Given a set of N items to be clustered, and an NxN
distance (or similarity) matrix, the basic process of
Johnson's (1967) hierarchical clustering is this:
 Start by assigning each item to its own cluster,
so that if you have N items, you now have N
clusters, each containing just one item. Let the
distances (similarities) between the clusters equal
the distances (similarities) between the items
they contain.
 Find the closest (most similar) pair of clusters
and merge them into a single cluster, so that
now you have one less cluster.
 Compute distances (similarities) between the
new cluster and each of the old clusters.
 Repeat steps 2 and 3 until all items are clustered
into a single cluster of size N.
Cluster = 4
Step 3 can be done in different ways, which is what
distinguishes single-linkage from complete-linkage and
average-linkage clustering.
 In single-linkage clustering, we consider the distance
between one cluster and another cluster to be equal
to the shortest distance from any member of one
cluster to any member of the other cluster.
 In complete-linkage clustering, we consider the
distance between one cluster and another cluster to
be equal to the greatest distance from any member of
one cluster to any member of the other cluster.
 In average-linkage clustering, we consider the distance
between one cluster and another cluster to be equal
to the average distance from any member of one
cluster to any member of the other cluster.
Single-linkage on density-
based clusters.
 Here is an example of Hierarchical clustering based on the Ruspini data.
Cluster = 4
 Another technique we can use for
clustering involves the application of the
EM algorithm for Gaussian Mixed Models.
 The approach uses the Mclust package in
R that utilizes the BIC statistic as the
measurement criteria.
 The goal for identifying the number of
clusters is to maximize the BIC.
 This approach is considered to be a fuzzy
clustering method.
 Here are some diagnostics which are useful to establish the correct fit to the data.
The maximum BIC
indicates that a Cluster = 5
should be used
 The Mclust classification chart depicts the 5 centroid distribution and also the relative
degree of the classification uncertainty.
 The contour plot shows the density of the data points relative to each of the
centroids.
 A similarity matrix is a matrix of scores
that represent the similarity between a
number of data points.
 Each element of the similarity matrix
contains a measure of similarity between
two of the data points.
 A distance matrix is a matrix (two-
dimensional array) containing the
distances, taken pairwise, of a set of
points.
 This matrix will have a size of N×N where
N is the number of points, nodes or
vertices (often in a graph).
Heat map of Similarity Matrix
Ex. Points on a graph
Distance Matrix
Heat map
 Here is an application of the Distance Matrix to the Ruspini dataset.
 Now we will reorder the distance matrix by the kmeans (k=4) algorithm.
 Now we bring in the dissplot to compare the heatmap against expected values.
We are looking for symmetry between the observed colors and the expected
colors.
 This is an example of an incorrect
kmeans specification of k = 3 instead
of k = 4.
 The heatmap shows that within the
1st cluster there appears to be
datapoints which should be
separated into an additional distinct
cluster.
 The similarity and distance matrices
can be powerful visual aids when
evaluating the fit of clusters.
 The goal of a clustering exercise should
be to identify the appropriate pockets or
groups of data that should be grouped
together.
 Because the structure of the underlying
data is usually unknown, there could be
many different clusters created by
different clustering techniques.
 Therefore, lets use a dataset where it is
obvious what the correct number of
clusters should be.
 This dataset clearly shows that there should be 4 clusters: 2 eyes, 1 nose, and 1 mouth.
 Lets first run a k-means clustering algorithm:
K = 6 Clusters The k-means produced too many
clusters based off of the dataset.
 Now lets use the Hierarchical clustering method:
K = 4 Clusters
 Reside in Wayne, Illinois
 Active Semi-Professional Classical Musician
(Bassoon).
 Married my wife on 10/10/10 and been
together for 10 years.
 Pet Yorkshire Terrier / Toy Poodle named
Brunzie.
 Pet Maine Coons’ named Maximus Power and
Nemesis Gul du Cat.
 Enjoy Cooking, Hiking, Cycling, Kayaking, and
Astronomy.
 Self proclaimed Data Nerd and Technology
Lover.
 http://www.stat.washington.edu/mclust/
 http://www.stats.gla.ac.uk/glossary/?q=node/451
 http://www.norusis.com/pdf/SPC_v13.pdf
 http://en.wikipedia.org/wiki/Cluster_analysis
 http://michael.hahsler.net/SMU/EMIS7332/R/chap8.html
 http://home.deib.polimi.it/matteucc/Clustering/tutorial_html/kmeans.html
 http://www.autonlab.org/tutorials/gmm14.pdf
 http://en.wikipedia.org/wiki/Distance_matrix
Data Science - Part VII -  Cluster Analysis

Contenu connexe

Tendances

Statistics and Data Mining
Statistics and  Data MiningStatistics and  Data Mining
Statistics and Data Mining
R A Akerkar
 
Chap8 basic cluster_analysis
Chap8 basic cluster_analysisChap8 basic cluster_analysis
Chap8 basic cluster_analysis
guru_prasadg
 

Tendances (20)

Outlier analysis and anomaly detection
Outlier analysis and anomaly detectionOutlier analysis and anomaly detection
Outlier analysis and anomaly detection
 
Neural Networks in Data Mining - “An Overview”
Neural Networks  in Data Mining -   “An Overview”Neural Networks  in Data Mining -   “An Overview”
Neural Networks in Data Mining - “An Overview”
 
3.5 model based clustering
3.5 model based clustering3.5 model based clustering
3.5 model based clustering
 
Statistics and Data Mining
Statistics and  Data MiningStatistics and  Data Mining
Statistics and Data Mining
 
Introduction to Linear Discriminant Analysis
Introduction to Linear Discriminant AnalysisIntroduction to Linear Discriminant Analysis
Introduction to Linear Discriminant Analysis
 
Unsupervised learning (clustering)
Unsupervised learning (clustering)Unsupervised learning (clustering)
Unsupervised learning (clustering)
 
Density based clustering
Density based clusteringDensity based clustering
Density based clustering
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Classification and Clustering
Classification and ClusteringClassification and Clustering
Classification and Clustering
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering Algorithm
 
Classification and Clustering
Classification and ClusteringClassification and Clustering
Classification and Clustering
 
Clustering & classification
Clustering & classificationClustering & classification
Clustering & classification
 
Presentation on K-Means Clustering
Presentation on K-Means ClusteringPresentation on K-Means Clustering
Presentation on K-Means Clustering
 
Outlier detection method introduction
Outlier detection method introductionOutlier detection method introduction
Outlier detection method introduction
 
CART – Classification & Regression Trees
CART – Classification & Regression TreesCART – Classification & Regression Trees
CART – Classification & Regression Trees
 
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
 
Chap8 basic cluster_analysis
Chap8 basic cluster_analysisChap8 basic cluster_analysis
Chap8 basic cluster_analysis
 
Types of clustering and different types of clustering algorithms
Types of clustering and different types of clustering algorithmsTypes of clustering and different types of clustering algorithms
Types of clustering and different types of clustering algorithms
 
05 Clustering in Data Mining
05 Clustering in Data Mining05 Clustering in Data Mining
05 Clustering in Data Mining
 
Data cleaning-outlier-detection
Data cleaning-outlier-detectionData cleaning-outlier-detection
Data cleaning-outlier-detection
 

Similaire à Data Science - Part VII - Cluster Analysis

Slide-TIF311-DM-10-11.ppt
Slide-TIF311-DM-10-11.pptSlide-TIF311-DM-10-11.ppt
Slide-TIF311-DM-10-11.ppt
ImXaib
 
8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm
Laura Petrosanu
 
Unsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and AssumptionsUnsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and Assumptions
refedey275
 
Assessing the compactness and isolation of individual clusters
Assessing the compactness and isolation of individual clustersAssessing the compactness and isolation of individual clusters
Assessing the compactness and isolation of individual clusters
perfj
 
CSA 3702 machine learning module 3
CSA 3702 machine learning module 3CSA 3702 machine learning module 3
CSA 3702 machine learning module 3
Nandhini S
 

Similaire à Data Science - Part VII - Cluster Analysis (20)

Slide-TIF311-DM-10-11.ppt
Slide-TIF311-DM-10-11.pptSlide-TIF311-DM-10-11.ppt
Slide-TIF311-DM-10-11.ppt
 
Slide-TIF311-DM-10-11.ppt
Slide-TIF311-DM-10-11.pptSlide-TIF311-DM-10-11.ppt
Slide-TIF311-DM-10-11.ppt
 
8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm
 
Survey on Unsupervised Learning in Datamining
Survey on Unsupervised Learning in DataminingSurvey on Unsupervised Learning in Datamining
Survey on Unsupervised Learning in Datamining
 
Literature Survey On Clustering Techniques
Literature Survey On Clustering TechniquesLiterature Survey On Clustering Techniques
Literature Survey On Clustering Techniques
 
15857 cse422 unsupervised-learning
15857 cse422 unsupervised-learning15857 cse422 unsupervised-learning
15857 cse422 unsupervised-learning
 
A0310112
A0310112A0310112
A0310112
 
Ch 4 Cluster Analysis.pdf
Ch 4 Cluster Analysis.pdfCh 4 Cluster Analysis.pdf
Ch 4 Cluster Analysis.pdf
 
Unsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and AssumptionsUnsupervised learning Algorithms and Assumptions
Unsupervised learning Algorithms and Assumptions
 
Neural nw k means
Neural nw k meansNeural nw k means
Neural nw k means
 
CLUSTERING IN DATA MINING.pdf
CLUSTERING IN DATA MINING.pdfCLUSTERING IN DATA MINING.pdf
CLUSTERING IN DATA MINING.pdf
 
47 292-298
47 292-29847 292-298
47 292-298
 
Data Mining: Cluster Analysis
Data Mining: Cluster AnalysisData Mining: Cluster Analysis
Data Mining: Cluster Analysis
 
cluster analysis
cluster analysiscluster analysis
cluster analysis
 
Machine learning session9(clustering)
Machine learning   session9(clustering)Machine learning   session9(clustering)
Machine learning session9(clustering)
 
Assessing the compactness and isolation of individual clusters
Assessing the compactness and isolation of individual clustersAssessing the compactness and isolation of individual clusters
Assessing the compactness and isolation of individual clusters
 
CSA 3702 machine learning module 3
CSA 3702 machine learning module 3CSA 3702 machine learning module 3
CSA 3702 machine learning module 3
 
ClustIII.ppt
ClustIII.pptClustIII.ppt
ClustIII.ppt
 
12 types of clustering
12 types of clustering12 types of clustering
12 types of clustering
 
clustering ppt.pptx
clustering ppt.pptxclustering ppt.pptx
clustering ppt.pptx
 

Plus de Derek Kane

Plus de Derek Kane (16)

Data Science - Part XVII - Deep Learning & Image Processing
Data Science - Part XVII - Deep Learning & Image ProcessingData Science - Part XVII - Deep Learning & Image Processing
Data Science - Part XVII - Deep Learning & Image Processing
 
Data Science - Part XVI - Fourier Analysis
Data Science - Part XVI - Fourier AnalysisData Science - Part XVI - Fourier Analysis
Data Science - Part XVI - Fourier Analysis
 
Data Science - Part XV - MARS, Logistic Regression, & Survival Analysis
Data Science -  Part XV - MARS, Logistic Regression, & Survival AnalysisData Science -  Part XV - MARS, Logistic Regression, & Survival Analysis
Data Science - Part XV - MARS, Logistic Regression, & Survival Analysis
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
 
Data Science - Part XIII - Hidden Markov Models
Data Science - Part XIII - Hidden Markov ModelsData Science - Part XIII - Hidden Markov Models
Data Science - Part XIII - Hidden Markov Models
 
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
 
Data Science - Part XI - Text Analytics
Data Science - Part XI - Text AnalyticsData Science - Part XI - Text Analytics
Data Science - Part XI - Text Analytics
 
Data Science - Part X - Time Series Forecasting
Data Science - Part X - Time Series ForecastingData Science - Part X - Time Series Forecasting
Data Science - Part X - Time Series Forecasting
 
Data Science - Part IX - Support Vector Machine
Data Science - Part IX -  Support Vector MachineData Science - Part IX -  Support Vector Machine
Data Science - Part IX - Support Vector Machine
 
Data Science - Part VIII - Artifical Neural Network
Data Science - Part VIII -  Artifical Neural NetworkData Science - Part VIII -  Artifical Neural Network
Data Science - Part VIII - Artifical Neural Network
 
Data Science - Part VI - Market Basket and Product Recommendation Engines
Data Science - Part VI - Market Basket and Product Recommendation EnginesData Science - Part VI - Market Basket and Product Recommendation Engines
Data Science - Part VI - Market Basket and Product Recommendation Engines
 
Data Science - Part V - Decision Trees & Random Forests
Data Science - Part V - Decision Trees & Random Forests Data Science - Part V - Decision Trees & Random Forests
Data Science - Part V - Decision Trees & Random Forests
 
Data Science - Part IV - Regression Analysis & ANOVA
Data Science - Part IV - Regression Analysis & ANOVAData Science - Part IV - Regression Analysis & ANOVA
Data Science - Part IV - Regression Analysis & ANOVA
 
Data Science - Part III - EDA & Model Selection
Data Science - Part III - EDA & Model SelectionData Science - Part III - EDA & Model Selection
Data Science - Part III - EDA & Model Selection
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
 
Data Science - Part I - Sustaining Predictive Analytics Capabilities
Data Science - Part I - Sustaining Predictive Analytics CapabilitiesData Science - Part I - Sustaining Predictive Analytics Capabilities
Data Science - Part I - Sustaining Predictive Analytics Capabilities
 

Dernier

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Dernier (20)

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 

Data Science - Part VII - Cluster Analysis

  • 2.  Introduction to Clustering Techniques  K-Means  Hierarchical Clustering  Gaussian Mixed Model  Visualization of Distance Matrix  Practical Example
  • 3.  Cluster analysis or clustering is the task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar (in some sense or another) to each other than to those in other groups (clusters).  It is a main task of exploratory data mining, and a common technique for statistical data analysis, used in many fields, including machine learning, pattern recognition, image analysis, information retrieval, and bioinformatics.  Cluster analysis itself is not one specific algorithm, but the general task to be solved.
  • 4. There are many real world applications of clustering:  Grouping or Hierarchies of Products  Recommendation Engines  Biological Classification  Typologies  Crime Analysis  Medical Imaging  Market Research  Social Network Analysis  Markov Chain Monte Carlo Methods
  • 5.  According to Vladimir Estivill-Castro, the notion of a "cluster" cannot be precisely defined, which is one of the reasons why there are so many clustering algorithms.  There is no objectively "correct" clustering algorithm, but as it was noted, "clustering is in the eye of the beholder.“ There are many different types of clustering models including:  Connectivity models  Centroid models  Distribution models  Density models  Group models  Graph-based models
  • 6.  A "clustering" is essentially a set of such clusters, usually containing all objects in the data set.  Additionally, it may specify the relationship of the clusters to each other, for example a hierarchy of clusters embedded in each other. Clusterings can be roughly distinguished as:  hard clustering: each object belongs to a cluster or not.  soft clustering (also: fuzzy clustering): each object belongs to each cluster to a certain degree (e.g. a likelihood of belonging to the cluster).
  • 7.  K-means is one of the simplest unsupervised learning algorithms that solve the well known clustering problem. The algorithm is composed of the following steps:  Place K points into the space represented by the objects that are being clustered. These points represent initial group centroids.  Assign each object to the group that has the closest centroid.  When all objects have been assigned, recalculate the positions of the K centroids.  Repeat Steps 2 and 3 until the centroids no longer move.  The k-means algorithm does not necessarily find the most optimal configuration, corresponding to the global objective function minimum.  The algorithm is also significantly sensitive to the initial randomly selected cluster centers.
  • 8.  A scree plot is a graphical display of the variance of each (cluster) component in the dataset which is used to determine how many components should be retained in order to explain a high percentage of the variation in the data.  The variance of each component is calculated using the following formula: λi∑i=1nλi where λi is the ith eigenvalue and ∑i=1nλi is the sum of all of the eigenvalues.  The plot shows the variance for the first component and then for the subsequent components, it shows the additional variance that each component is adding.
  • 9.  A scree plot is sometimes referred to as an “elbow” plot.  In order to identify the optimal number of clusters for further analysis, we need to look for the “bend” in the graph at the elbow. # of Clusters should be 3 or 4
  • 10.  Silhouette refers to a method of interpretation and validation of clusters of data.  The silhouette technique provides a succinct graphical representation of how well each object lies within its cluster and was first described by Peter J. Rousseeuw in 1986.
  • 11.  The goal of a silhouette plot is to identify the point of the highest Average Silhouette Width (ASW). This is the optimal number of clusters for the analysis. Cluster = 4
  • 12.  The Cluster plot shows the spread of the data within each of the generated clusters.  A Principal Component Analysis (greater than 2 dimensions) can be utilized to view the clustering.
  • 13.  Here is an example of K-Means clustering based on the Ruspini data. Cluster = 4
  • 14.  Hierarchical clustering (or hierarchic clustering ) outputs a hierarchy, a structure that is more informative than the unstructured set of clusters returned by flat clustering.  Hierarchical clustering does not require us to prespecify the number of clusters and most hierarchical algorithms that have been used in IR are deterministic.  These advantages of hierarchical clustering come at the cost of lower efficiency.
  • 15. Given a set of N items to be clustered, and an NxN distance (or similarity) matrix, the basic process of Johnson's (1967) hierarchical clustering is this:  Start by assigning each item to its own cluster, so that if you have N items, you now have N clusters, each containing just one item. Let the distances (similarities) between the clusters equal the distances (similarities) between the items they contain.  Find the closest (most similar) pair of clusters and merge them into a single cluster, so that now you have one less cluster.  Compute distances (similarities) between the new cluster and each of the old clusters.  Repeat steps 2 and 3 until all items are clustered into a single cluster of size N. Cluster = 4
  • 16. Step 3 can be done in different ways, which is what distinguishes single-linkage from complete-linkage and average-linkage clustering.  In single-linkage clustering, we consider the distance between one cluster and another cluster to be equal to the shortest distance from any member of one cluster to any member of the other cluster.  In complete-linkage clustering, we consider the distance between one cluster and another cluster to be equal to the greatest distance from any member of one cluster to any member of the other cluster.  In average-linkage clustering, we consider the distance between one cluster and another cluster to be equal to the average distance from any member of one cluster to any member of the other cluster. Single-linkage on density- based clusters.
  • 17.  Here is an example of Hierarchical clustering based on the Ruspini data. Cluster = 4
  • 18.  Another technique we can use for clustering involves the application of the EM algorithm for Gaussian Mixed Models.  The approach uses the Mclust package in R that utilizes the BIC statistic as the measurement criteria.  The goal for identifying the number of clusters is to maximize the BIC.  This approach is considered to be a fuzzy clustering method.
  • 19.  Here are some diagnostics which are useful to establish the correct fit to the data. The maximum BIC indicates that a Cluster = 5 should be used
  • 20.  The Mclust classification chart depicts the 5 centroid distribution and also the relative degree of the classification uncertainty.
  • 21.  The contour plot shows the density of the data points relative to each of the centroids.
  • 22.  A similarity matrix is a matrix of scores that represent the similarity between a number of data points.  Each element of the similarity matrix contains a measure of similarity between two of the data points.  A distance matrix is a matrix (two- dimensional array) containing the distances, taken pairwise, of a set of points.  This matrix will have a size of N×N where N is the number of points, nodes or vertices (often in a graph). Heat map of Similarity Matrix
  • 23. Ex. Points on a graph Distance Matrix Heat map
  • 24.  Here is an application of the Distance Matrix to the Ruspini dataset.
  • 25.  Now we will reorder the distance matrix by the kmeans (k=4) algorithm.
  • 26.  Now we bring in the dissplot to compare the heatmap against expected values. We are looking for symmetry between the observed colors and the expected colors.
  • 27.  This is an example of an incorrect kmeans specification of k = 3 instead of k = 4.  The heatmap shows that within the 1st cluster there appears to be datapoints which should be separated into an additional distinct cluster.  The similarity and distance matrices can be powerful visual aids when evaluating the fit of clusters.
  • 28.
  • 29.  The goal of a clustering exercise should be to identify the appropriate pockets or groups of data that should be grouped together.  Because the structure of the underlying data is usually unknown, there could be many different clusters created by different clustering techniques.  Therefore, lets use a dataset where it is obvious what the correct number of clusters should be.
  • 30.  This dataset clearly shows that there should be 4 clusters: 2 eyes, 1 nose, and 1 mouth.
  • 31.  Lets first run a k-means clustering algorithm: K = 6 Clusters The k-means produced too many clusters based off of the dataset.
  • 32.  Now lets use the Hierarchical clustering method: K = 4 Clusters
  • 33.  Reside in Wayne, Illinois  Active Semi-Professional Classical Musician (Bassoon).  Married my wife on 10/10/10 and been together for 10 years.  Pet Yorkshire Terrier / Toy Poodle named Brunzie.  Pet Maine Coons’ named Maximus Power and Nemesis Gul du Cat.  Enjoy Cooking, Hiking, Cycling, Kayaking, and Astronomy.  Self proclaimed Data Nerd and Technology Lover.
  • 34.  http://www.stat.washington.edu/mclust/  http://www.stats.gla.ac.uk/glossary/?q=node/451  http://www.norusis.com/pdf/SPC_v13.pdf  http://en.wikipedia.org/wiki/Cluster_analysis  http://michael.hahsler.net/SMU/EMIS7332/R/chap8.html  http://home.deib.polimi.it/matteucc/Clustering/tutorial_html/kmeans.html  http://www.autonlab.org/tutorials/gmm14.pdf  http://en.wikipedia.org/wiki/Distance_matrix