SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Dendogram
Hierarchical Clustering : Its slow :: complicated :: repeatable :: not suited for big
data sets.
Lets take 6 simple Vectors.
6 Vectors
Using Euclidean Distance lets compute the Distance Matrix.
Euclidean Distance = sqrt( (x2 -x1)**2 + (y2-y1)**2 )
Using Euclidean Distance lets compute the Distance Matrix.
Euclidean Distance = sqrt( (x2 -x1)**2 + (y2-y1)**2 )
Distance Matrix
Complete Link Clustering: Considers Max of all distances. Leads to many small
clusters.
Distance Matrix: Diagonals will be 0 and values will be symmetric.
Stage 0
Step a: The shortest distance in the matrix is 1 and the vectors associated with that
are C & D
So the first cluster is C — D
Distance between other vectors and CD
A to CD = max(A->C, A->D) = max(25,24) = 25
B to CD = max(B-<C, B->D) = max(21,20) = 21
and similarly find for E -> CD & F -> CD
Stage 1
Step b : Now 2 is the shortest distance and the vectors associated with that are E & F
Second cluster is E — F
A to EF = max(A->E, A->F) = max(9,7) = 9
CD to EF = max(CD->E, CD->F) = max(15,17) = 17
Step c : Now 4 is the shortest distance and vectors associated are A & B. Third cluster
is A — B
CD to AB = max(CD -> A, CD ->B) = max(25,21) = 25
EF to AB = max(EF -> A, EF ->B) = max(9,5) = 9
Step d : Now 9 is the shortest distance and vectors associated are AB and EF. Fourth
cluster is AB — EF
CD to ABEF = max(CD->AB, CD->EF) = max(25,18) = 25
Step e : Last cluster is CD — ABEF
Let’s take a sample of 5 students:
Creating a Proximity Matrix
First, we will create a proximity matrix which will tell us the distance between each of
these points. S
ince we are calculating the distance of each point from each of the
other points, we will get a square matrix of shape n X n (where n is the number of
observations).
Let’s make the 5 x 5 proximity matrix for our example:
Step 1: First, we assign all the points to an individual cluster:
Different colors here represent different clusters. You can see that we have 5
different clusters for the 5 points in our data.
Step 2: Next, we will look at the smallest distance in the proximity matrix and merge
the points with the smallest distance. We then update the proximity matrix:
Here, the smallest distance is 3 and hence we will merge point 1 and 2:
Let’s look at the updated clusters and accordingly update the proximity matrix:
Here, we have taken the maximum of the two marks (7, 10) to replace the marks for
this cluster. Instead of the maximum, we can also take the minimum value or the
average values as well. Now, we will again calculate the proximity matrix for these
clusters:
Step 3: We will repeat step 2 until only a single cluster is left.
So, we will first look at the minimum distance in the proximity matrix and then merge
the closest pair of clusters. We will get the merged clusters as shown below after
repeating these steps:
How should we Choose the Number of Clusters in Hierarchical Clustering?
Let’s get back to our teacher-student example. Whenever we merge two clusters, a
dendrogram will record the distance between these clusters and represent it in graph
form. Let’s see how a dendrogram looks like:
We have the samples of the dataset on the x-axis and the distance on the y-
axis. Whenever two clusters are merged, we will join them in this dendrogram and
the height of the join will be the distance between these points.
Let’s build the dendrogram for our example:
Take a moment to process the above image. We started by merging sample 1 and 2
and the distance between these two samples was 3 (refer to the first proximity matrix
in the previous section).
Let’s plot this in the dendrogram:
Here, we can see that we have merged sample 1 and 2. The vertical line represents
the distance between these samples. S
imilarly, we plot all the steps where we merged
the clusters and finally, we get a dendrogram like this:
Now, we can set a threshold distance and draw a horizontal line (Generally, we try to
set the threshold in such a way that it cuts the tallest vertical line). Let’s set this threshold
as 12 and draw a horizontal line:
The number of clusters will be the number of vertical lines which are being
intersected by the line drawn using the threshold. In the above example, since the
red line intersects 2 vertical lines, we will have 2 clusters. One cluster will have a
sample (1,2,4) and the other will have a sample (3,5).

Weitere Àhnliche Inhalte

Ähnlich wie Clustering-dendogram.pptx

Designing a Minimum Distance classifier to Class Mean Classifier
Designing a Minimum Distance classifier to Class Mean ClassifierDesigning a Minimum Distance classifier to Class Mean Classifier
Designing a Minimum Distance classifier to Class Mean ClassifierDipesh Shome
 
Hierarchical clustering
Hierarchical clusteringHierarchical clustering
Hierarchical clusteringishmecse13
 
K mean-clustering
K mean-clusteringK mean-clustering
K mean-clusteringAfzaal Subhani
 
11-2-Clustering.pptx
11-2-Clustering.pptx11-2-Clustering.pptx
11-2-Clustering.pptxpaktari1
 
[PPT]
[PPT][PPT]
[PPT]butest
 
Enhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetEnhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetAlaaZ
 
Unsupervised Learning in Machine Learning
Unsupervised Learning in Machine LearningUnsupervised Learning in Machine Learning
Unsupervised Learning in Machine LearningPyingkodi Maran
 
Cluster analysis
Cluster analysisCluster analysis
Cluster analysisAvijit Famous
 
2012 mdsp pr09 pca lda
2012 mdsp pr09 pca lda2012 mdsp pr09 pca lda
2012 mdsp pr09 pca ldanozomuhamada
 
Pattern Recognition - Designing a minimum distance class mean classifier
Pattern Recognition - Designing a minimum distance class mean classifierPattern Recognition - Designing a minimum distance class mean classifier
Pattern Recognition - Designing a minimum distance class mean classifierNayem Nayem
 
Traveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed EnvironmentTraveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed Environmentcsandit
 
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENTTRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENTcscpconf
 
Vectorise all the things
Vectorise all the thingsVectorise all the things
Vectorise all the thingsJodieBurchell1
 
Kakuro: Solving the Constraint Satisfaction Problem
Kakuro: Solving the Constraint Satisfaction ProblemKakuro: Solving the Constraint Satisfaction Problem
Kakuro: Solving the Constraint Satisfaction ProblemVarad Meru
 
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...ArchiLab 7
 
Lect4
Lect4Lect4
Lect4sumit621
 

Ähnlich wie Clustering-dendogram.pptx (20)

Designing a Minimum Distance classifier to Class Mean Classifier
Designing a Minimum Distance classifier to Class Mean ClassifierDesigning a Minimum Distance classifier to Class Mean Classifier
Designing a Minimum Distance classifier to Class Mean Classifier
 
Hierarchical clustering
Hierarchical clusteringHierarchical clustering
Hierarchical clustering
 
K mean-clustering
K mean-clusteringK mean-clustering
K mean-clustering
 
11-2-Clustering.pptx
11-2-Clustering.pptx11-2-Clustering.pptx
11-2-Clustering.pptx
 
[PPT]
[PPT][PPT]
[PPT]
 
overviewPCA
overviewPCAoverviewPCA
overviewPCA
 
Enhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetEnhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial Dataset
 
Unsupervised Learning in Machine Learning
Unsupervised Learning in Machine LearningUnsupervised Learning in Machine Learning
Unsupervised Learning in Machine Learning
 
MSE.pptx
MSE.pptxMSE.pptx
MSE.pptx
 
Cluster analysis
Cluster analysisCluster analysis
Cluster analysis
 
2012 mdsp pr09 pca lda
2012 mdsp pr09 pca lda2012 mdsp pr09 pca lda
2012 mdsp pr09 pca lda
 
Pattern Recognition - Designing a minimum distance class mean classifier
Pattern Recognition - Designing a minimum distance class mean classifierPattern Recognition - Designing a minimum distance class mean classifier
Pattern Recognition - Designing a minimum distance class mean classifier
 
Clustering
ClusteringClustering
Clustering
 
Project
ProjectProject
Project
 
Traveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed EnvironmentTraveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed Environment
 
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENTTRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
 
Vectorise all the things
Vectorise all the thingsVectorise all the things
Vectorise all the things
 
Kakuro: Solving the Constraint Satisfaction Problem
Kakuro: Solving the Constraint Satisfaction ProblemKakuro: Solving the Constraint Satisfaction Problem
Kakuro: Solving the Constraint Satisfaction Problem
 
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
 
Lect4
Lect4Lect4
Lect4
 

KĂŒrzlich hochgeladen

BhubaneswarđŸŒčKalpana Mesuem ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
BhubaneswarđŸŒčKalpana Mesuem  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...BhubaneswarđŸŒčKalpana Mesuem  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
BhubaneswarđŸŒčKalpana Mesuem ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...Call Girls Mumbai
 
Mahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot GirlsMahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot GirlsDeepika Singh
 
✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...jabtakhaidam7
 
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...priyasharma62062
 
Vip Call Girls Ravi Tailkes 😉 Bhubaneswar 9777949614 Housewife Call Girls Se...
Vip Call Girls Ravi Tailkes 😉  Bhubaneswar 9777949614 Housewife Call Girls Se...Vip Call Girls Ravi Tailkes 😉  Bhubaneswar 9777949614 Housewife Call Girls Se...
Vip Call Girls Ravi Tailkes 😉 Bhubaneswar 9777949614 Housewife Call Girls Se...Call Girls Mumbai
 
BhubaneswarđŸŒčRavi Tailkes ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...
BhubaneswarđŸŒčRavi Tailkes  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...BhubaneswarđŸŒčRavi Tailkes  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...
BhubaneswarđŸŒčRavi Tailkes ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...Call Girls Mumbai
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetSareena Khatun
 
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X79953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...batoole333
 
Technology industry / Finnish economic outlook
Technology industry / Finnish economic outlookTechnology industry / Finnish economic outlook
Technology industry / Finnish economic outlookTechFinland
 
[[Nerul]] MNavi Mumbai Honoreble Call Girls Number-9833754194-Panvel Best Es...
[[Nerul]] MNavi Mumbai Honoreble  Call Girls Number-9833754194-Panvel Best Es...[[Nerul]] MNavi Mumbai Honoreble  Call Girls Number-9833754194-Panvel Best Es...
[[Nerul]] MNavi Mumbai Honoreble Call Girls Number-9833754194-Panvel Best Es...priyasharma62062
 
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...kajal
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfAdnet Communications
 
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdf
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdfSeeman_Fiintouch_LLP_Newsletter_May-2024.pdf
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdfAshis Kumar Dey
 
Vip Call Girls Bhubaneswar😉 Bhubaneswar 9777949614 Housewife Call Girls Serv...
Vip Call Girls Bhubaneswar😉  Bhubaneswar 9777949614 Housewife Call Girls Serv...Vip Call Girls Bhubaneswar😉  Bhubaneswar 9777949614 Housewife Call Girls Serv...
Vip Call Girls Bhubaneswar😉 Bhubaneswar 9777949614 Housewife Call Girls Serv...Call Girls Mumbai
 
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...priyasharma62062
 
Significant AI Trends for the Financial Industry in 2024 and How to Utilize Them
Significant AI Trends for the Financial Industry in 2024 and How to Utilize ThemSignificant AI Trends for the Financial Industry in 2024 and How to Utilize Them
Significant AI Trends for the Financial Industry in 2024 and How to Utilize Them360factors
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...priyasharma62062
 
Pension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfPension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfHenry Tapper
 
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X79953056974 Low Rate Call Girls In Saket, Delhi NCR
 

KĂŒrzlich hochgeladen (20)

BhubaneswarđŸŒčKalpana Mesuem ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
BhubaneswarđŸŒčKalpana Mesuem  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...BhubaneswarđŸŒčKalpana Mesuem  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
BhubaneswarđŸŒčKalpana Mesuem ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
 
Mahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot GirlsMahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts đŸ„° 8617370543 Call Girls Offer VIP Hot Girls
 
✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
 
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
 
Vip Call Girls Ravi Tailkes 😉 Bhubaneswar 9777949614 Housewife Call Girls Se...
Vip Call Girls Ravi Tailkes 😉  Bhubaneswar 9777949614 Housewife Call Girls Se...Vip Call Girls Ravi Tailkes 😉  Bhubaneswar 9777949614 Housewife Call Girls Se...
Vip Call Girls Ravi Tailkes 😉 Bhubaneswar 9777949614 Housewife Call Girls Se...
 
BhubaneswarđŸŒčRavi Tailkes ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...
BhubaneswarđŸŒčRavi Tailkes  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...BhubaneswarđŸŒčRavi Tailkes  ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...
BhubaneswarđŸŒčRavi Tailkes ❀CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswar ...
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
 
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
 
Technology industry / Finnish economic outlook
Technology industry / Finnish economic outlookTechnology industry / Finnish economic outlook
Technology industry / Finnish economic outlook
 
[[Nerul]] MNavi Mumbai Honoreble Call Girls Number-9833754194-Panvel Best Es...
[[Nerul]] MNavi Mumbai Honoreble  Call Girls Number-9833754194-Panvel Best Es...[[Nerul]] MNavi Mumbai Honoreble  Call Girls Number-9833754194-Panvel Best Es...
[[Nerul]] MNavi Mumbai Honoreble Call Girls Number-9833754194-Panvel Best Es...
 
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdf
 
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdf
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdfSeeman_Fiintouch_LLP_Newsletter_May-2024.pdf
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdf
 
Vip Call Girls Bhubaneswar😉 Bhubaneswar 9777949614 Housewife Call Girls Serv...
Vip Call Girls Bhubaneswar😉  Bhubaneswar 9777949614 Housewife Call Girls Serv...Vip Call Girls Bhubaneswar😉  Bhubaneswar 9777949614 Housewife Call Girls Serv...
Vip Call Girls Bhubaneswar😉 Bhubaneswar 9777949614 Housewife Call Girls Serv...
 
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
 
Significant AI Trends for the Financial Industry in 2024 and How to Utilize Them
Significant AI Trends for the Financial Industry in 2024 and How to Utilize ThemSignificant AI Trends for the Financial Industry in 2024 and How to Utilize Them
Significant AI Trends for the Financial Industry in 2024 and How to Utilize Them
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
 
Pension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfPension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdf
 
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 

Clustering-dendogram.pptx

  • 1. Dendogram Hierarchical Clustering : Its slow :: complicated :: repeatable :: not suited for big data sets. Lets take 6 simple Vectors. 6 Vectors Using Euclidean Distance lets compute the Distance Matrix. Euclidean Distance = sqrt( (x2 -x1)**2 + (y2-y1)**2 )
  • 2. Using Euclidean Distance lets compute the Distance Matrix. Euclidean Distance = sqrt( (x2 -x1)**2 + (y2-y1)**2 ) Distance Matrix Complete Link Clustering: Considers Max of all distances. Leads to many small clusters. Distance Matrix: Diagonals will be 0 and values will be symmetric. Stage 0
  • 3. Step a: The shortest distance in the matrix is 1 and the vectors associated with that are C & D So the first cluster is C — D Distance between other vectors and CD A to CD = max(A->C, A->D) = max(25,24) = 25 B to CD = max(B-<C, B->D) = max(21,20) = 21 and similarly find for E -> CD & F -> CD Stage 1
  • 4. Step b : Now 2 is the shortest distance and the vectors associated with that are E & F Second cluster is E — F A to EF = max(A->E, A->F) = max(9,7) = 9 CD to EF = max(CD->E, CD->F) = max(15,17) = 17 Step c : Now 4 is the shortest distance and vectors associated are A & B. Third cluster is A — B CD to AB = max(CD -> A, CD ->B) = max(25,21) = 25 EF to AB = max(EF -> A, EF ->B) = max(9,5) = 9
  • 5. Step d : Now 9 is the shortest distance and vectors associated are AB and EF. Fourth cluster is AB — EF CD to ABEF = max(CD->AB, CD->EF) = max(25,18) = 25 Step e : Last cluster is CD — ABEF
  • 6. Let’s take a sample of 5 students: Creating a Proximity Matrix First, we will create a proximity matrix which will tell us the distance between each of these points. S ince we are calculating the distance of each point from each of the other points, we will get a square matrix of shape n X n (where n is the number of observations). Let’s make the 5 x 5 proximity matrix for our example:
  • 7. Step 1: First, we assign all the points to an individual cluster: Different colors here represent different clusters. You can see that we have 5 different clusters for the 5 points in our data. Step 2: Next, we will look at the smallest distance in the proximity matrix and merge the points with the smallest distance. We then update the proximity matrix: Here, the smallest distance is 3 and hence we will merge point 1 and 2:
  • 8. Let’s look at the updated clusters and accordingly update the proximity matrix: Here, we have taken the maximum of the two marks (7, 10) to replace the marks for this cluster. Instead of the maximum, we can also take the minimum value or the average values as well. Now, we will again calculate the proximity matrix for these clusters:
  • 9. Step 3: We will repeat step 2 until only a single cluster is left. So, we will first look at the minimum distance in the proximity matrix and then merge the closest pair of clusters. We will get the merged clusters as shown below after repeating these steps:
  • 10. How should we Choose the Number of Clusters in Hierarchical Clustering? Let’s get back to our teacher-student example. Whenever we merge two clusters, a dendrogram will record the distance between these clusters and represent it in graph form. Let’s see how a dendrogram looks like: We have the samples of the dataset on the x-axis and the distance on the y- axis. Whenever two clusters are merged, we will join them in this dendrogram and the height of the join will be the distance between these points.
  • 11. Let’s build the dendrogram for our example: Take a moment to process the above image. We started by merging sample 1 and 2 and the distance between these two samples was 3 (refer to the first proximity matrix in the previous section).
  • 12. Let’s plot this in the dendrogram: Here, we can see that we have merged sample 1 and 2. The vertical line represents the distance between these samples. S imilarly, we plot all the steps where we merged the clusters and finally, we get a dendrogram like this:
  • 13. Now, we can set a threshold distance and draw a horizontal line (Generally, we try to set the threshold in such a way that it cuts the tallest vertical line). Let’s set this threshold as 12 and draw a horizontal line: The number of clusters will be the number of vertical lines which are being intersected by the line drawn using the threshold. In the above example, since the red line intersects 2 vertical lines, we will have 2 clusters. One cluster will have a sample (1,2,4) and the other will have a sample (3,5).