SlideShare a Scribd company logo
K-Means Clustering is an Unsupervised Learning algorithm, which groups the unlabeled
dataset into different clusters. Here K defines the number of pre-defined clusters that need to be
created in the process, as if K=2, there will be two clusters, and for K=3, there will be three clusters,
and so on.
Manhattan distance
Problem
Cluster the following eight points (with (x, y) representing locations) into three clusters: A1(2, 10),
A2(2, 5), A3(8, 4), A4(5, 8), A5(7, 5), A6(6, 4), A7(1, 2), A8(4, 9). Initial cluster centers are:
A1(2, 10), A4(5, 8) and A7(1, 2). Use K-Means Algorithm to find the three cluster centers after
the second iteration.
Solution
Iteration-01
Given Points
Distance from
center (2, 10) of
Cluster-01
Distance from
center (5, 8) of
Cluster-02
Distance from
center (1, 2) of
Cluster-03
Point belongs
to Cluster
A1(2, 10) 0 5 9 C1
A2(2, 5) 5 6 4 C3
A3(8, 4) 12 7 9 C2
A4(5, 8) 5 0 10 C2
A5(7, 5) 10 5 9 C2
A6(6, 4) 10 5 7 C2
A7(1, 2) 9 10 0 C3
A8(4, 9) 3 2 10 C2
From here, New clusters are-
Cluster-01: A1(2, 10)
Cluster-02: A3(8, 4), A4(5, 8), A5(7, 5), A6(6, 4), A8(4, 9)
Cluster-03: A2(2, 5), A7(1, 2)
The new cluster center is computed by taking mean of all the points contained in that cluster.
For Cluster-01: We have only one point A1(2, 10) in Cluster-01. So, cluster center remains the
same.
For Cluster-02: Center of Cluster-02
= ((8 + 5 + 7 + 6 + 4)/5, (4 + 8 + 5 + 4 + 9)/5)
= (6, 6)
For Cluster-03: Center of Cluster-03
= ((2 + 1)/2, (5 + 2)/2)
= (1.5, 3.5)
Iteration-02:
Given Points
Distance from
center (2, 10) of
Cluster-01
Distance from
center (6, 6) of
Cluster-02
Distance from
center (1.5, 3.5) of
Cluster-03
Point belongs to
Cluster
A1(2, 10) 0 8 7 C1
A2(2, 5) 5 5 2 C3
A3(8, 4) 12 4 7 C2
A4(5, 8) 5 3 8 C2
A5(7, 5) 10 2 7 C2
A6(6, 4) 10 2 5 C2
A7(1, 2) 9 9 2 C3
A8(4, 9) 3 5 8 C1
From here, New clusters are-
Cluster-01: A1(2, 10), A8(4, 9)
Cluster-02: A3(8, 4), A4(5, 8), A5(7, 5), A6(6, 4)
Cluster-03: A2(2, 5), A7(1, 2)
The new cluster center is computed by taking mean of all the points contained in that cluster.
For Cluster-01: Center of Cluster-01
= ((2 + 4)/2, (10 + 9)/2)
= (3, 9.5)
For Cluster-02: Center of Cluster-02
= ((8 + 5 + 7 + 6)/4, (4 + 8 + 5 + 4)/4)
= (6.5, 5.25)
For Cluster-03: Center of Cluster-03
= ((2 + 1)/2, (5 + 2)/2)
= (1.5, 3.5)
This is completion of Iteration-02.
After second iteration, the center of the three clusters are-
• C1(3, 9.5)
• C2(6.5, 5.25)
• C3(1.5, 3.5)
Iteration-03
Given Points
Distance from
center (3, 9.5) of
Cluster-01
Distance from
center (6.5, 5.25)
of Cluster-02
Distance from
center (1.5, 3.5) of
Cluster-03
Point belongs to
Cluster
A1(2, 10) 1.5 9.25 7 C1
A2(2, 5) 5.5 4.75 2 C3
A3(8, 4) 10.5 2.75 7 C2
A4(5, 8) 3.5 4.25 8 C1
A5(7, 5) 8.5 0.75 7 C2
A6(6, 4) 8.5 1.75 5 C2
A7(1, 2) 9.5 8.75 2 C3
A8(4, 9) 1.5 6.25 8 C1
From here, New clusters are-
Cluster-01: A1(2, 10), A4(5, 8), A8(4, 9)
Cluster-02: A3(8, 4), A5(7, 5), A6(6, 4)
Cluster-03: A2(2, 5), A7(1, 2)
The new cluster center is computed by taking mean of all the points contained in that cluster.
For Cluster-01: Center of Cluster-01
= ((2 + 5 + 4)/3, (10 + 8 + 9)/3)
= (3.67, 9)
For Cluster-02: Center of Cluster-02
= ((8 + 7 + 6)/3, (4 + 5 + 4)/3)
= (7, 4.33)
For Cluster-03: Center of Cluster-03
= ((2 + 1)/2, (5 + 2)/2)
= (1.5, 3.5)
This is completion of Iteration-02.
After second iteration, the center of the three clusters are-
• C1(3.67, 9)
• C2(7, 4.33)
• C3(1.5, 3.5)
Iteration-04
Given Points
Distance from
center (3.67, 9)
of Cluster-01
Distance from
center (7, 4.33) of
Cluster-02
Distance from
center (1.5, 3.5) of
Cluster-03
Point belongs to
Cluster
A1(2, 10) 2.67 10.67 7 C1
A2(2, 5) 5.67 5.67 2 C3
A3(8, 4) 9.33 1.33 7 C2
A4(5, 8) 2.33 5.67 8 C1
A5(7, 5) 7.33 0.67 7 C2
A6(6, 4) 7.33 1.33 5 C2
A7(1, 2) 9.67 8.33 2 C3
A8(4, 9) 0.33 7.67 8 C1
From here, clusters are-
Cluster-01: A1(2, 10), A4(5, 8), A8(4, 9)
Cluster-02: A3(8, 4), A5(7, 5), A6(6, 4)
Cluster-03: A2(2, 5), A7(1, 2)
Ad

More Related Content

Similar to K Means Clustering Algorithm in Machine Learning.pdf (20)

K means clustering
K means clusteringK means clustering
K means clustering
Ahmedasbasb
 
1.1.3 Midpoint and Partitions
1.1.3 Midpoint and Partitions1.1.3 Midpoint and Partitions
1.1.3 Midpoint and Partitions
smiller5
 
MATLAB ARRAYS
MATLAB ARRAYSMATLAB ARRAYS
MATLAB ARRAYS
Aditya Choudhury
 
ML.pptx
ML.pptxML.pptx
ML.pptx
AroundWorldLM10
 
1.1.5 Midpoint and Partition Formulas
1.1.5 Midpoint and Partition Formulas1.1.5 Midpoint and Partition Formulas
1.1.5 Midpoint and Partition Formulas
smiller5
 
Fishers linear discriminant for dimensionality reduction.
Fishers linear discriminant for dimensionality reduction.Fishers linear discriminant for dimensionality reduction.
Fishers linear discriminant for dimensionality reduction.
Nurul Amin Choudhury
 
A novel steganographic method for jpeg images
A novel steganographic method for jpeg imagesA novel steganographic method for jpeg images
A novel steganographic method for jpeg images
Ajit Kumar Pradhan
 
coefficient variation
coefficient variationcoefficient variation
coefficient variation
MARIA KATRINA MACAPAZ
 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
Lakshmi Sarvani Videla
 
6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf
6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf
6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf
RoseyAckerman
 
6-Distance-and-Midpoint-bxnxFormula (1).pptx
6-Distance-and-Midpoint-bxnxFormula (1).pptx6-Distance-and-Midpoint-bxnxFormula (1).pptx
6-Distance-and-Midpoint-bxnxFormula (1).pptx
RoseyAckerman
 
Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Example
kailash shaw
 
Obj. 5 Midpoint and Distance Formulas
Obj. 5 Midpoint and Distance FormulasObj. 5 Midpoint and Distance Formulas
Obj. 5 Midpoint and Distance Formulas
smiller5
 
Functions and their Graphs (mid point)
Functions and their Graphs (mid point)Functions and their Graphs (mid point)
Functions and their Graphs (mid point)
Nadeem Uddin
 
Basics of Matlab for students and faculty
Basics of Matlab for students and facultyBasics of Matlab for students and faculty
Basics of Matlab for students and faculty
AbhishekRanjan17318
 
Es 10 2019 features
Es 10 2019 featuresEs 10 2019 features
Es 10 2019 features
Vardan Meliksetyan
 
1.1.1C Midpoint and Distance Formulas
1.1.1C Midpoint and Distance Formulas1.1.1C Midpoint and Distance Formulas
1.1.1C Midpoint and Distance Formulas
smiller5
 
The distance formula
The distance formulaThe distance formula
The distance formula
Shaun Wilson
 
Obj. 7 Midpoint and Distance Formulas
Obj. 7 Midpoint and Distance FormulasObj. 7 Midpoint and Distance Formulas
Obj. 7 Midpoint and Distance Formulas
smiller5
 
Numeros reales, inecuaciones y desigualdades
Numeros reales, inecuaciones y desigualdadesNumeros reales, inecuaciones y desigualdades
Numeros reales, inecuaciones y desigualdades
DanielaAngulo25
 
K means clustering
K means clusteringK means clustering
K means clustering
Ahmedasbasb
 
1.1.3 Midpoint and Partitions
1.1.3 Midpoint and Partitions1.1.3 Midpoint and Partitions
1.1.3 Midpoint and Partitions
smiller5
 
1.1.5 Midpoint and Partition Formulas
1.1.5 Midpoint and Partition Formulas1.1.5 Midpoint and Partition Formulas
1.1.5 Midpoint and Partition Formulas
smiller5
 
Fishers linear discriminant for dimensionality reduction.
Fishers linear discriminant for dimensionality reduction.Fishers linear discriminant for dimensionality reduction.
Fishers linear discriminant for dimensionality reduction.
Nurul Amin Choudhury
 
A novel steganographic method for jpeg images
A novel steganographic method for jpeg imagesA novel steganographic method for jpeg images
A novel steganographic method for jpeg images
Ajit Kumar Pradhan
 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
Lakshmi Sarvani Videla
 
6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf
6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf
6-Distance-and-Mifvtyuvgyuugdpoint-Formula (1).pdf
RoseyAckerman
 
6-Distance-and-Midpoint-bxnxFormula (1).pptx
6-Distance-and-Midpoint-bxnxFormula (1).pptx6-Distance-and-Midpoint-bxnxFormula (1).pptx
6-Distance-and-Midpoint-bxnxFormula (1).pptx
RoseyAckerman
 
Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Example
kailash shaw
 
Obj. 5 Midpoint and Distance Formulas
Obj. 5 Midpoint and Distance FormulasObj. 5 Midpoint and Distance Formulas
Obj. 5 Midpoint and Distance Formulas
smiller5
 
Functions and their Graphs (mid point)
Functions and their Graphs (mid point)Functions and their Graphs (mid point)
Functions and their Graphs (mid point)
Nadeem Uddin
 
Basics of Matlab for students and faculty
Basics of Matlab for students and facultyBasics of Matlab for students and faculty
Basics of Matlab for students and faculty
AbhishekRanjan17318
 
1.1.1C Midpoint and Distance Formulas
1.1.1C Midpoint and Distance Formulas1.1.1C Midpoint and Distance Formulas
1.1.1C Midpoint and Distance Formulas
smiller5
 
The distance formula
The distance formulaThe distance formula
The distance formula
Shaun Wilson
 
Obj. 7 Midpoint and Distance Formulas
Obj. 7 Midpoint and Distance FormulasObj. 7 Midpoint and Distance Formulas
Obj. 7 Midpoint and Distance Formulas
smiller5
 
Numeros reales, inecuaciones y desigualdades
Numeros reales, inecuaciones y desigualdadesNumeros reales, inecuaciones y desigualdades
Numeros reales, inecuaciones y desigualdades
DanielaAngulo25
 

More from A. S. M. Shafi (20)

Data Warehouse Schema (Star, Snowflake).docx
Data Warehouse Schema (Star, Snowflake).docxData Warehouse Schema (Star, Snowflake).docx
Data Warehouse Schema (Star, Snowflake).docx
A. S. M. Shafi
 
Correlation Analysis in Machine Learning.pdf
Correlation Analysis in Machine Learning.pdfCorrelation Analysis in Machine Learning.pdf
Correlation Analysis in Machine Learning.pdf
A. S. M. Shafi
 
Naive Bayes and Decision Tree Algorithm.pdf
Naive Bayes and Decision Tree Algorithm.pdfNaive Bayes and Decision Tree Algorithm.pdf
Naive Bayes and Decision Tree Algorithm.pdf
A. S. M. Shafi
 
Frequent Pattern Growth Mining Algorithm.pdf
Frequent Pattern Growth Mining Algorithm.pdfFrequent Pattern Growth Mining Algorithm.pdf
Frequent Pattern Growth Mining Algorithm.pdf
A. S. M. Shafi
 
Direct Hashing and Pruning Algorithm in Data MIning.pdf
Direct Hashing and Pruning Algorithm in Data MIning.pdfDirect Hashing and Pruning Algorithm in Data MIning.pdf
Direct Hashing and Pruning Algorithm in Data MIning.pdf
A. S. M. Shafi
 
Association Rule Mining with Apriori Algorithm.pdf
Association Rule Mining with Apriori Algorithm.pdfAssociation Rule Mining with Apriori Algorithm.pdf
Association Rule Mining with Apriori Algorithm.pdf
A. S. M. Shafi
 
HITS Algorithm in Data and Web MIning.pdf
HITS Algorithm in Data and Web MIning.pdfHITS Algorithm in Data and Web MIning.pdf
HITS Algorithm in Data and Web MIning.pdf
A. S. M. Shafi
 
Page Rank Algorithm in Data Mining and Web Application.pdf
Page Rank Algorithm in Data Mining and Web Application.pdfPage Rank Algorithm in Data Mining and Web Application.pdf
Page Rank Algorithm in Data Mining and Web Application.pdf
A. S. M. Shafi
 
K Nearest Neighbor Classifier in Machine Learning.pdf
K Nearest Neighbor Classifier in Machine Learning.pdfK Nearest Neighbor Classifier in Machine Learning.pdf
K Nearest Neighbor Classifier in Machine Learning.pdf
A. S. M. Shafi
 
2D Transformation in Computer Graphics
2D Transformation in Computer Graphics2D Transformation in Computer Graphics
2D Transformation in Computer Graphics
A. S. M. Shafi
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
A. S. M. Shafi
 
Projection
ProjectionProjection
Projection
A. S. M. Shafi
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
A. S. M. Shafi
 
Line drawing algorithm
Line drawing algorithmLine drawing algorithm
Line drawing algorithm
A. S. M. Shafi
 
Fragmentation
FragmentationFragmentation
Fragmentation
A. S. M. Shafi
 
File organization
File organizationFile organization
File organization
A. S. M. Shafi
 
Bankers algorithm
Bankers algorithmBankers algorithm
Bankers algorithm
A. S. M. Shafi
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
A. S. M. Shafi
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
A. S. M. Shafi
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
A. S. M. Shafi
 
Data Warehouse Schema (Star, Snowflake).docx
Data Warehouse Schema (Star, Snowflake).docxData Warehouse Schema (Star, Snowflake).docx
Data Warehouse Schema (Star, Snowflake).docx
A. S. M. Shafi
 
Correlation Analysis in Machine Learning.pdf
Correlation Analysis in Machine Learning.pdfCorrelation Analysis in Machine Learning.pdf
Correlation Analysis in Machine Learning.pdf
A. S. M. Shafi
 
Naive Bayes and Decision Tree Algorithm.pdf
Naive Bayes and Decision Tree Algorithm.pdfNaive Bayes and Decision Tree Algorithm.pdf
Naive Bayes and Decision Tree Algorithm.pdf
A. S. M. Shafi
 
Frequent Pattern Growth Mining Algorithm.pdf
Frequent Pattern Growth Mining Algorithm.pdfFrequent Pattern Growth Mining Algorithm.pdf
Frequent Pattern Growth Mining Algorithm.pdf
A. S. M. Shafi
 
Direct Hashing and Pruning Algorithm in Data MIning.pdf
Direct Hashing and Pruning Algorithm in Data MIning.pdfDirect Hashing and Pruning Algorithm in Data MIning.pdf
Direct Hashing and Pruning Algorithm in Data MIning.pdf
A. S. M. Shafi
 
Association Rule Mining with Apriori Algorithm.pdf
Association Rule Mining with Apriori Algorithm.pdfAssociation Rule Mining with Apriori Algorithm.pdf
Association Rule Mining with Apriori Algorithm.pdf
A. S. M. Shafi
 
HITS Algorithm in Data and Web MIning.pdf
HITS Algorithm in Data and Web MIning.pdfHITS Algorithm in Data and Web MIning.pdf
HITS Algorithm in Data and Web MIning.pdf
A. S. M. Shafi
 
Page Rank Algorithm in Data Mining and Web Application.pdf
Page Rank Algorithm in Data Mining and Web Application.pdfPage Rank Algorithm in Data Mining and Web Application.pdf
Page Rank Algorithm in Data Mining and Web Application.pdf
A. S. M. Shafi
 
K Nearest Neighbor Classifier in Machine Learning.pdf
K Nearest Neighbor Classifier in Machine Learning.pdfK Nearest Neighbor Classifier in Machine Learning.pdf
K Nearest Neighbor Classifier in Machine Learning.pdf
A. S. M. Shafi
 
2D Transformation in Computer Graphics
2D Transformation in Computer Graphics2D Transformation in Computer Graphics
2D Transformation in Computer Graphics
A. S. M. Shafi
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
A. S. M. Shafi
 
Line drawing algorithm
Line drawing algorithmLine drawing algorithm
Line drawing algorithm
A. S. M. Shafi
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
A. S. M. Shafi
 
Ad

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Ad

K Means Clustering Algorithm in Machine Learning.pdf

  • 1. K-Means Clustering is an Unsupervised Learning algorithm, which groups the unlabeled dataset into different clusters. Here K defines the number of pre-defined clusters that need to be created in the process, as if K=2, there will be two clusters, and for K=3, there will be three clusters, and so on.
  • 2. Manhattan distance Problem Cluster the following eight points (with (x, y) representing locations) into three clusters: A1(2, 10), A2(2, 5), A3(8, 4), A4(5, 8), A5(7, 5), A6(6, 4), A7(1, 2), A8(4, 9). Initial cluster centers are: A1(2, 10), A4(5, 8) and A7(1, 2). Use K-Means Algorithm to find the three cluster centers after the second iteration. Solution Iteration-01 Given Points Distance from center (2, 10) of Cluster-01 Distance from center (5, 8) of Cluster-02 Distance from center (1, 2) of Cluster-03 Point belongs to Cluster A1(2, 10) 0 5 9 C1 A2(2, 5) 5 6 4 C3 A3(8, 4) 12 7 9 C2 A4(5, 8) 5 0 10 C2 A5(7, 5) 10 5 9 C2 A6(6, 4) 10 5 7 C2 A7(1, 2) 9 10 0 C3 A8(4, 9) 3 2 10 C2 From here, New clusters are- Cluster-01: A1(2, 10) Cluster-02: A3(8, 4), A4(5, 8), A5(7, 5), A6(6, 4), A8(4, 9) Cluster-03: A2(2, 5), A7(1, 2) The new cluster center is computed by taking mean of all the points contained in that cluster. For Cluster-01: We have only one point A1(2, 10) in Cluster-01. So, cluster center remains the same.
  • 3. For Cluster-02: Center of Cluster-02 = ((8 + 5 + 7 + 6 + 4)/5, (4 + 8 + 5 + 4 + 9)/5) = (6, 6) For Cluster-03: Center of Cluster-03 = ((2 + 1)/2, (5 + 2)/2) = (1.5, 3.5) Iteration-02: Given Points Distance from center (2, 10) of Cluster-01 Distance from center (6, 6) of Cluster-02 Distance from center (1.5, 3.5) of Cluster-03 Point belongs to Cluster A1(2, 10) 0 8 7 C1 A2(2, 5) 5 5 2 C3 A3(8, 4) 12 4 7 C2 A4(5, 8) 5 3 8 C2 A5(7, 5) 10 2 7 C2 A6(6, 4) 10 2 5 C2 A7(1, 2) 9 9 2 C3 A8(4, 9) 3 5 8 C1 From here, New clusters are- Cluster-01: A1(2, 10), A8(4, 9) Cluster-02: A3(8, 4), A4(5, 8), A5(7, 5), A6(6, 4) Cluster-03: A2(2, 5), A7(1, 2) The new cluster center is computed by taking mean of all the points contained in that cluster. For Cluster-01: Center of Cluster-01 = ((2 + 4)/2, (10 + 9)/2)
  • 4. = (3, 9.5) For Cluster-02: Center of Cluster-02 = ((8 + 5 + 7 + 6)/4, (4 + 8 + 5 + 4)/4) = (6.5, 5.25) For Cluster-03: Center of Cluster-03 = ((2 + 1)/2, (5 + 2)/2) = (1.5, 3.5) This is completion of Iteration-02. After second iteration, the center of the three clusters are- • C1(3, 9.5) • C2(6.5, 5.25) • C3(1.5, 3.5) Iteration-03 Given Points Distance from center (3, 9.5) of Cluster-01 Distance from center (6.5, 5.25) of Cluster-02 Distance from center (1.5, 3.5) of Cluster-03 Point belongs to Cluster A1(2, 10) 1.5 9.25 7 C1 A2(2, 5) 5.5 4.75 2 C3 A3(8, 4) 10.5 2.75 7 C2 A4(5, 8) 3.5 4.25 8 C1 A5(7, 5) 8.5 0.75 7 C2 A6(6, 4) 8.5 1.75 5 C2 A7(1, 2) 9.5 8.75 2 C3 A8(4, 9) 1.5 6.25 8 C1 From here, New clusters are- Cluster-01: A1(2, 10), A4(5, 8), A8(4, 9) Cluster-02: A3(8, 4), A5(7, 5), A6(6, 4) Cluster-03: A2(2, 5), A7(1, 2)
  • 5. The new cluster center is computed by taking mean of all the points contained in that cluster. For Cluster-01: Center of Cluster-01 = ((2 + 5 + 4)/3, (10 + 8 + 9)/3) = (3.67, 9) For Cluster-02: Center of Cluster-02 = ((8 + 7 + 6)/3, (4 + 5 + 4)/3) = (7, 4.33) For Cluster-03: Center of Cluster-03 = ((2 + 1)/2, (5 + 2)/2) = (1.5, 3.5) This is completion of Iteration-02. After second iteration, the center of the three clusters are- • C1(3.67, 9) • C2(7, 4.33) • C3(1.5, 3.5) Iteration-04 Given Points Distance from center (3.67, 9) of Cluster-01 Distance from center (7, 4.33) of Cluster-02 Distance from center (1.5, 3.5) of Cluster-03 Point belongs to Cluster A1(2, 10) 2.67 10.67 7 C1 A2(2, 5) 5.67 5.67 2 C3 A3(8, 4) 9.33 1.33 7 C2 A4(5, 8) 2.33 5.67 8 C1 A5(7, 5) 7.33 0.67 7 C2 A6(6, 4) 7.33 1.33 5 C2 A7(1, 2) 9.67 8.33 2 C3 A8(4, 9) 0.33 7.67 8 C1
  • 6. From here, clusters are- Cluster-01: A1(2, 10), A4(5, 8), A8(4, 9) Cluster-02: A3(8, 4), A5(7, 5), A6(6, 4) Cluster-03: A2(2, 5), A7(1, 2)