Вы находитесь на странице: 1из 18

Topic:

K-Mean Algorithm(one variable and Two


variable)
Contents
 What is clustering

 Clustering types

 K mean clustering

 Solve with k2 technique


What is clustering?
Clustering
• The method of identifying similar groups of data set is called
clustering.
• Entities in each group are comparatively more similar to
entities of that group than those of the other groups.
Clustering e.g

• Just like daraz.pk and Alibaba and any other website, group
the same accessories just like electronic thing in one group
and begs in another group, these groups clusters.
Types of Clustering
Hierarchical Clustering

• Produces a set of nested clusters organized as a hierarchical


tree
• Can be visualized as a dendrogram
• A tree like diagram that records the sequences of merges
or splits
Example

Electronic
Devices

Mobile Laptop Tv/LCD ETC

Window
oppo Phone Apple
Non-Hierarchical Clustering

• A division of objects into non-overlapping subsets(cluster)


such that each object in exactly one cluster.
Clustering types

• There are many types of cluster.


• But our focus is on Central clustering/Partition
Clustering/non-hierarchical Clustering because it solve with
k-mean techniques.
kitche
n

whole data electr begs


onic
sports
fashio
shoes n
etc
K mean clustering
K mean clustering

• K-means clustering is a simple unsupervised learning


algorithm that is used to solve clustering problems.

• The goal of this algorithm is to find groups in the data, with


the number of groups represented by the variable K.

Example:
Inventory categorization:
• Group inventory by sales activity
• Group inventory by manufacturing metrics
Steps
1) Take mean value
2) Find nearest number of mean put in cluster
3) Go to step2
4) Repeat step 1 and 2 until get same mean
K2 clustering
Given {2,3,4,10,11,12,20,25,30}
m1=4 m2=12
k1={2,3,4} k2={10,11,12,20,25,30}
k1=2+3+4/3 k2=10+11+12+20+25/6
k1=9/3=3 k2=108/6=18
New mean value
m1=3 m2=18
k1={2,3,4,10} k2={11,12,20,25,30}
k1=19/4=4.75 k2=98/5=19.6
k1=4.75=5 k2=19.6=20
New mean value is 5 and 20
m1=5 m2=20
k1={2,3,4,10,11,12} k2={20,25,30}
k1=42/6 =7 k2 =75/3=25
New mean value is 7 and 25
m1=7 m2=25
k1={2,3,4,10,11,12} k2={20,25,30}
k1=42/6 =7 k2 =75/3=25
New mean value is again 7 and 25
but here we stop it because we have same mean
value and same k1 and k2 cluster.
Thank you :D

Вам также может понравиться