<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prince Deepak Siddharth on Medium]]></title>
        <description><![CDATA[Stories by Prince Deepak Siddharth on Medium]]></description>
        <link>https://medium.com/@prince31dece?source=rss-6a0d6e986d95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*p2s3e3_sSRvfq_gb</url>
            <title>Stories by Prince Deepak Siddharth on Medium</title>
            <link>https://medium.com/@prince31dece?source=rss-6a0d6e986d95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 19:05:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prince31dece/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[K-Means Clustering Algorithm-Understandings]]></title>
            <link>https://medium.com/@prince31dece/k-means-clustering-algorithm-understandings-6a321e1c81d4?source=rss-6a0d6e986d95------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a321e1c81d4</guid>
            <dc:creator><![CDATA[Prince Deepak Siddharth]]></dc:creator>
            <pubDate>Sat, 20 Jul 2024 23:25:11 GMT</pubDate>
            <atom:updated>2026-02-15T15:56:51.225Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Guys , In this Blog, I am writing about my understanding of K-Means Clustering algorithm - Introduction, Geometric analysis, working of algorithm, Elbow curve method, Implementation of algorithm, Real life examples, Advantages and Limitation of a algorithm</p><p>I am currently pursuing my Bachelor of technology from department Computer science and Engineering from <strong>Indian Institute of Information Technology, Jabalpur, MP.</strong> I am AI/ML enthusiast.</p><p>From our Institute esteemed club ‘<strong>The Programming Club (TPC)</strong>’ organized the <strong>Summer of Machine Learning(SoM)</strong> in which our TPC AI/ML wing members taught us about Machine Learning concepts like Supervised or Unsupervised learning , Neural Network, Deep Learning, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-vmVGmGsOZLriWSZ" /></figure><p>So, I am here to share my understandings about unsupervised learning technique ‘K-Means Clustering Algorithm’. Before dive into K-means Clustering Algorithm , lets take a quick summary of Unsupervised learning.</p><h3><strong>Clustering(Unsupervised Learning)</strong></h3><ul><li>In this technique , we group the<strong> unlabelled</strong> data.</li><li>A way of grouping the data points into different clusters consisting of similar data points.</li><li>The object with possible similarities remain in group that has less or no similarities with another group.</li></ul><p><strong>Some real life example :</strong></p><ul><li>It is used by Amazon, YouTube, Netflix in its recommendation systems to provide recommendation as per the past searches of products, videos, movies respectively.</li></ul><p><strong>Types:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*CsjLylpN4LgcIshB4s60mQ.png" /></figure><ol><li><strong>Portioning Clustering</strong>: It divide the data into non-hierarchical groups. It is also known as Centroid based Method.<br>Ex: K-Means Clustering algorithm.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*WlHnLFCF503RHAnFGYxHNg.jpeg" /></figure><p>2. <strong>Density Clustering</strong> : It connect highly dense area into cluster and arbitrarily shaped distributed are formed as long as dense region can be connected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*jlLxZMybKjiW2pjRFVmepw.png" /></figure><p>3. <strong>Distribution Model based clustering </strong>: The data is divided based on probability of how a dataset belongs to particular distribution . The grouping is done by assuming same distribution commonly Gaussian Distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*a6865r70hEXP-v7_a64Isg.png" /></figure><p>4.<strong> Hierarchical clustering</strong> : It can be used as alternatively for partitional clustering as there is non-requirement of pre-specifying no. of cluster to be created , datasets is divided into clusters to create <strong>dendrogram</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*DTHaAkyK9-iodo0eqsvJIw.png" /></figure><p>5. <strong>Fuzzy clustering</strong> : It is a type of <strong>soft method</strong> in which data object may belong to more than one cluster. Each dataset has a set of membership coefficients, which depend on degree of membership to be in a cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*8Ul6vsjuOZ9NLSxsMquyeg.png" /></figure><p>Now Summary has done and we will go toward on my understanding of K-Means Algorithm, for which this blog is for.</p><h3><strong>K-Means Clustering Algorithm</strong></h3><p>K-Means is a popular and widely used method in machine learning for clustering data. Clustering is the task of grouping a set of objects in such a way that objects in the same group (or cluster) are more similar to each other than to those in other groups. K-Means specifically aims to partition a dataset into K clusters, where K is a number specified by the user.</p><p>Keywords:</p><ul><li><strong>Clusters</strong>: Groups of similar data points.</li><li><strong>Centroids</strong>: The central point of each cluster. In K-Means, each cluster is represented by its centroid, which is the arithmetic mean of the points in the cluster.</li><li><strong>Distance Measure</strong>: Typically, the Euclidean distance is used to measure the distance between data points and centroids</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*iAQJrJhfaNdgWVsEZwvanw.png" /></figure><h3><strong>Geometrical Analysis:</strong></h3><p>:- Steps</p><ol><li><strong>Decide no. of clusters (n)or(k)</strong> : We doesn’t know the value of k in starting of implementation and we can’t decide k value by seeing graph of dataset because it is easier to decide k-value by plotting 2-D scatterplot or 3-D scatterplot but generally we having data into N-dimension it then it is impossible to decide k-value. <br>- How?<br> k-value determined by elbow curve discussed after topic Working of algorithm.</li><li><strong>Initialize Centroids</strong> : K initial points (centroids) randomly from the dataset. These points will be the initial centers of your clusters.<br>Initialize simply by taking mean of all X &amp; Y coordinates of respective cluster.</li><li><strong>Assign points to cluster : </strong>For each data point, calculate which centroid it is closest to, and assign the point to that cluster. Closeness of centroid by calculating Euclidean distance.</li><li><strong>Update centroids position :</strong> Recalculate and update centroids of respective cluster simply by taking mean of all X &amp; Y coordinates of respective cluster.</li><li><strong>Checking Centroids position :</strong> Compare centroids position old and updated ,if they are unequal then goto Step -3 and perform step as in flow ,if they are equal then finish the algorithm.</li><li><strong>Finish</strong></li></ol><h3>Flowchart of Algorithm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*bhwGpTSlje9_-Qf1EUR61g.png" /><figcaption>Flowchart of K-means clustering Algorithm</figcaption></figure><h3><strong>Working of K-means clustering algorithm</strong></h3><p>Lets understands the working of algorithm:</p><ul><li>According to Step 1- let no of clusters(k)=3</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*6CHmQai-aC4qA3PkihZHQQ.png" /><figcaption>No of cluster =3</figcaption></figure><ul><li>According to step 2 — Initializing Centroids</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*TgeoiVrKqtTYco0NLQN2oA.png" /></figure><ul><li>According to Step 3- Assigns points to clusters by calculating distance between centroids and points.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*LCabtZgaILTKAFnKMruM3g.png" /></figure><ul><li>According to Step 4 — Update centroids position</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*4QJ4mVi4nH78_EPQ6g_ysg.png" /></figure><ul><li>According to Step 5- Checking centroids position ,here centroid position changes . So old centroids not equal to new centroids. Now condition failed and flow of execution got to Step 3 again.</li><li>According to Step 3- Assigns points to clusters by calculating distance between centroids and points. Now centroids are updated .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*PBZfkxcfOZ7f88FdwOTeYw.png" /></figure><ul><li>According to Step 4- Update centroids position , but by seeing this upper graph , we can say that centroids will not change.</li><li>According to Step 5- Condition becomes true.</li></ul><p>Hence algorithm finished by Clustered the data.</p><p>So, this was a working of K- means clustering Algorithm .</p><h3><strong>Elbow Curve Method</strong></h3><p>We will determine the value of k (no. of clusters) by Elbow curve method.</p><p>In Elbow curve , we plot a graph WCSS(Within Clusters Sum of Squares) or Intensity VS No. of clusters(k)</p><ul><li><strong>WCSS </strong>— Within Cluster Sum of Squares <br>It represents the sum of the squared distances between each data point and the centroid of its assigned cluster. The goal in K-Means clustering is to minimize the WCSS, as a lower WCSS indicates that the data points are closer to their respective centroids, meaning the clusters are more compact and well-defined.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*gBGFTGxZsfCIfLwjM8KfwA.png" /></figure><p><strong>Elbow curve</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*HyujutgatWKWS7FA2BB2sA.png" /></figure><ul><li>k value = Elbow point value , no of cluster should be 4. <br>Because, after k = 1 to k = 2 and k = 2 to k = 3 and k = 3 to K = 4 the change in Intensity is more but after K = 4 we will get very less change in Intensity .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*2WvS296Ah-5kHbN40u6-xg.png" /></figure><h3>Implementation Of K-Means Clustering Algorithm</h3><p>Implementation done in Steps:</p><ol><li>Finding K- Value plotting Elbow Curve.</li><li>Implementation of Algorithm</li></ol><p>Taking datasets name Student.csv consisting Features name [ ‘cgpa’ , ‘iq’]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*bmoKhJAKdCOoK82vsb3uLQ.png" /></figure><p>For using K- means Clustering algorithm, we have to import algo from scikit- learn library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*EyqmdfdKlFErmnl7TeCEfw.png" /></figure><ol><li><strong>Determining K- Value plotting Elbow Curve</strong></li></ol><pre>import numpy as np<br>import pandas as pd<br><br># for ignore warnings<br>import warnings<br>warnings.filterwarnings(&quot;ignore&quot;)<br><br># Loading the datasets<br>df = pd.read_csv(&#39;student_clustering.csv&#39;)<br>print(&quot;The shape of data is&quot;,df.shape)<br><br># importing matplot for plotting the plots<br>import matplotlib.pyplot as plt<br><br># importing K-means clustering algorithm<br>from sklearn.cluster import KMeans<br><br># For getting WCSS <br>wcss = []<br><br>for i in range(1,11):<br>    km = KMeans(n_clusters=i)<br>    km.fit_predict(df)<br>    wcss.append(km.inertia_) # km.inertia_ gives all the WCSS of all respective k values<br><br># plotting the elbow curve<br>plt.plot(range(1,11),wcss)<br>plt.title(&#39;Elbow Curve&#39;)<br>plt.xlabel(&#39;Number of clusters&#39;)<br>plt.ylabel(&#39;WCSS (Intensity)&#39;)<br>plt.show()<br><br><br></pre><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*Boqyvx9kMM4C5frEiuMDQQ.png" /></figure><p>From this Elbow curve, We can decide k value by seeing elbow point.<br>So <strong>k = 4.</strong></p><p><strong>2. Implementation of Algorithm</strong></p><ul><li>By using Scikit-learn library, we can implement k-means clustering to n-dimensional dataset ,here I am implementing algorithm on 2-D dataset</li></ul><pre># importing the required libraries<br>import matplotlib.pyplot as plt<br>from sklearn.cluster import KMeans<br>import pandas as pd<br>import numpy as np<br><br># Loading the datasets<br>df = pd.read_csv(&#39;student_clustering.csv&#39;)<br><br># coverting the data into array<br>X = df.iloc[:,:].values<br><br># importing K-means clustering algorithm<br>km = KMeans(n_clusters=4)<br>y_means = km.fit_predict(X)<br><br># plotting the clusters<br>plt.scatter(X[y_means == 0,0],X[y_means == 0,1],color=&#39;red&#39;) #plotting the points which belongs to cluster 0<br>plt.scatter(X[y_means == 1,0],X[y_means == 1,1],color=&#39;blue&#39;) # plotting the points which belongs to cluster 1<br>plt.scatter(X[y_means == 2,0],X[y_means == 2,1],color=&#39;green&#39;) #plotting the points which belongs to cluster 2<br>plt.scatter(X[y_means == 3,0],X[y_means == 3,1],color=&#39;yellow&#39;) #plotting the points which belongs to cluster 3<br># [y_means == 0,0] means the points which belongs to cluster 0 and 0th column of the data<br># [y_means == 0,1] means the points which belongs to cluster 0 and 1st column of the data<br><br># plotting the centroids of the clusters<br>plt.scatter(km.cluster_centers_[:,0],km.cluster_centers_[:,1],color=&#39;black&#39;,marker=&#39;*&#39;,label=&#39;Centroids&#39;)<br># km.cluster_centers_[:,0] gives the x coordinates of the centroids&#39; points<br># km.cluster_centers_[:,1] gives the y coordinates of the centroids&#39; points<br><br>plt.title(&#39;K-means Clustering&#39;)<br>plt.xlabel(&#39;CGPA&#39;)<br>plt.ylabel(&#39;IQ&#39;)<br><br><br># plotting the centroids of the clusters<br>plt.show()</pre><p>Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*UOFsrcRM7HIwZJXuFKi2gA.png" /></figure><ul><li><strong>Implementation of algorithm on 3-D datasets:</strong></li></ul><p>First of all we will create dataset by using Scikit learn library importing <strong><em>make_blobs</em></strong>.</p><p>Q. What is <strong><em>make_blobs</em></strong>.</p><p><strong>Ans:</strong></p><p><strong><em>make_blobs</em> </strong>is a function from the <strong><em>sklearn.datasets</em></strong> module that generates synthetic datasets for clustering. It&#39;s useful for creating datasets with a specified number of clusters, which can be used to test clustering algorithms.</p><pre>make_blobs(n_samples=100, n_feaures=2, centers=None, cluster_std=1.0, center_box=(-10.0, 10.0), shuffle=True, random_state=None, return_centers=False)</pre><p><strong>Parameters:</strong><br>1. n_samples (default=100):</p><ul><li>If an integer, it specifies the total number of samples to generate.</li><li>If an array-like, each element indicates the number of samples for each cluster.</li></ul><p>2. n_features (default=2):</p><ul><li>The number of features (dimensions) for each sample.</li></ul><p>3. centers (default=None):</p><ul><li>If an integer, it specifies the number of centers (clusters) to generate.</li><li>If an array-like, it provides the coordinates of the centers. The array shape should be (n_centers, n_features).</li></ul><p>3. cluster_std (default=1.0):</p><ul><li>The standard deviation of the clusters. If a single float, all clusters have the same standard deviation.</li><li>If an array-like, each element specifies the standard deviation for each cluster.</li></ul><p>4. center_box ((min, max), default=(-10.0, 10.0)):</p><ul><li>The bounding box for each cluster center when centers are generated randomly.</li></ul><p>5. shuffle (default=True):</p><ul><li>Whether to shuffle the samples.</li></ul><p>6. random_state (default=None):</p><ul><li>Determines the random number generation for dataset creation.<br>Pass an int for reproducible output across multiple function calls.</li></ul><p>7. return_centers (default=False):</p><ul><li>If True, return the centers of the generated blobs.</li></ul><p>Returns:</p><ul><li>X (array of shape [n_samples, n_features]): The generated samples.</li><li>y (array of shape [n_samples]): The integer labels for cluster membership of each sample.</li><li>centers (array of shape [n_centers, n_features], optional): The centers of the clusters. Returned if return_centers=True.</li></ul><p><strong>Finding k value by plotting Elbow curve:</strong></p><pre>import numpy as np<br>import pandas as pd<br>from sklearn.datasets import make_blobs<br><br># for ignore warnings<br>import warnings<br>warnings.filterwarnings(&quot;ignore&quot;)<br><br># creating the datasets by using make_blobs<br>centroids = [(-2,-4,6),(5,4,-5),(3.5,-8.5,4),(-2.5,-2.5,-4)]<br>cluster_std = [1,1,1,1]<br><br>X,y,centres3d_value = make_blobs(n_samples=300,cluster_std=cluster_std,centers=centroids,n_features=3,return_centers=True,random_state=1)<br><br># importing matplot for plotting the plots<br>import matplotlib.pyplot as plt<br><br># importing K-means clustering algorithm<br>from sklearn.cluster import KMeans<br><br># For getting WCSS <br>wcss = []<br><br>for i in range(1,21):<br>    km = KMeans(n_clusters=i)<br>    km.fit_predict(X)<br>    wcss.append(km.inertia_) # km.inertia_ gives all the WCSS on k values<br><br># plotting the elbow curve<br>plt.plot(range(1,21),wcss)<br>plt.xticks(range(1,21,1))<br>plt.title(&#39;Elbow Curve&#39;)<br>plt.xlabel(&#39;Number of clusters&#39;)<br>plt.ylabel(&#39;WCSS (Intensity)&#39;)<br>plt.show()</pre><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*XsKrSHcfwu69WcyfSnc2jw.png" /></figure><p>From this Elbow curve, We can decide k value by seeing elbow point.<br>So <strong>k = 4.</strong></p><p><strong>Implementation of K-means on 3-D Datasets</strong></p><pre>import numpy as np<br>import pandas as pd<br>from sklearn.datasets import make_blobs<br># importing matplot for plotting the plots<br>import matplotlib.pyplot as plt<br># for 3d plotting<br>import plotly.express as px<br><br># for ignore warnings<br>import warnings<br>warnings.filterwarnings(&quot;ignore&quot;)<br><br># creating the datasets by using make_blobs<br>centroids = [(-2,-4,6),(5,4,-5),(3.5,-8.5,4),(-2.5,-2.5,-4)]<br>cluster_std = [1,1,1,1]<br><br>X,y,centres3d_value = make_blobs(n_samples=300,cluster_std=cluster_std,centers=centroids,n_features=3,return_centers=True,random_state=1)<br><br><br><br># importing K-means clustering algorithm<br>from sklearn.cluster import KMeans<br><br>km = KMeans(n_clusters=4)<br>y_pred = km.fit_predict(X)<br><br><br># creating the dataframe for 3d plotting<br>df = pd.DataFrame()<br><br>df[&#39;col1&#39;] = X[:,0]<br>df[&#39;col2&#39;] = X[:,1]<br>df[&#39;col3&#39;] = X[:,2]<br>df[&#39;label&#39;] = y_pred<br><br># 3d plotting<br>fig = px.scatter_3d(df,x=&#39;col1&#39;, y=&#39;col2&#39;, z=&#39;col3&#39;,color=&#39;label&#39;)<br>fig.show()</pre><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*neu76Lqfo22rS1_CmQs1gg.png" /></figure><p>Explanation<strong> <em>make_blobs</em></strong> function:</p><ul><li><strong>centroids</strong>: Specifies the coordinates of the four cluster centers in a 3-dimensional space.</li><li><strong>cluster_std</strong>: Specifies that each cluster has a standard deviation of 1.</li><li><strong>n_samples</strong>=300: Specifies that 300 samples will be generated.</li><li><strong>n_features</strong>=3: Specifies that each sample will have 3 features.</li><li><strong>random_state</strong>=1: Ensures reproducibility by setting the random number generator seed.</li></ul><p><strong>Implementing K-means Clustering algorithm from Scratch in Python:</strong></p><pre>import random<br>import numpy as np<br><br>class KMeans:<br>    def __init__(self,n_clusters=2,max_iter=100):<br>        self.n_clusters = n_clusters<br>        self.max_iter = max_iter<br>        self.centroids = None<br><br>    def fit_predict(self,X):<br><br>        random_index = random.sample(range(0,X.shape[0]),self.n_clusters)<br>        self.centroids = X[random_index]<br><br>        for i in range(self.max_iter):<br>            # assign clusters<br>            cluster_group = self.assign_clusters(X)<br>            old_centroids = self.centroids<br>            # move centroids<br>            self.centroids = self.move_centroids(X,cluster_group)<br>            # check finish<br>            if (old_centroids == self.centroids).all():<br>                break<br><br>        return cluster_group<br><br>    def assign_clusters(self,X):<br>        cluster_group = []<br>        distances = []<br><br>        for row in X:<br>            for centroid in self.centroids:<br>                distances.append(np.sqrt(np.dot(row-centroid,row-centroid)))<br>            min_distance = min(distances)<br>            index_pos = distances.index(min_distance)<br>            cluster_group.append(index_pos)<br>            distances.clear()<br><br>        return np.array(cluster_group)<br><br>    def move_centroids(self,X,cluster_group):<br>        new_centroids = []<br><br>        cluster_type = np.unique(cluster_group)<br><br>        for type in cluster_type:<br>            new_centroids.append(X[cluster_group == type].mean(axis=0))<br><br>        return np.array(new_centroids)<br>    <br>from sklearn.datasets import make_blobs<br>import matplotlib.pyplot as plt<br>from kmeans import KMeans<br>import pandas as pd<br><br>df = pd.read_csv(&#39;student_clustering.csv&#39;)<br><br>X = df.iloc[:,:].values<br><br>km = KMeans(n_clusters=4,max_iter=800)<br>y_means = km.fit_predict(X)<br><br>plt.scatter(X[y_means == 0,0],X[y_means == 0,1],color=&#39;red&#39;)<br>plt.scatter(X[y_means == 1,0],X[y_means == 1,1],color=&#39;blue&#39;)<br>plt.scatter(X[y_means == 2,0],X[y_means == 2,1],color=&#39;green&#39;)<br>plt.scatter(X[y_means == 3,0],X[y_means == 3,1],color=&#39;yellow&#39;)<br>plt.show()</pre><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*3hO31C-asDeVvjWhIsFFpw.png" /></figure><h3>Advantages and Limitations</h3><p><strong>Advantages:</strong></p><ul><li><strong>Simplicity</strong>: Easy to understand and implement.</li><li><strong>Efficiency</strong>: Works well with large datasets.</li><li><strong>Speed</strong>: Converges quickly compared to other clustering algorithms.</li></ul><p><strong>Limitations:</strong></p><ul><li><strong>Number of Clusters (K)</strong>: Requires the user to specify the number of clusters in advance.</li><li><strong>Initial Centroids</strong>: Sensitive to the initial placement of centroids, which can lead to different results.</li><li><strong>Shape of Clusters</strong>: Assumes clusters are spherical and equally sized, which may not always be the case in real-world data.</li></ul><h3><strong>Some Real-World Examples of use of K-Means Clustering algorithm</strong></h3><ol><li><strong>Customer Segmentation in Marketing</strong></li></ol><ul><li><strong>Objective:</strong> To group customers based on their purchasing behavior and demographics.</li></ul><p>2. <strong>Image Compression</strong></p><ul><li><strong>Objective</strong>: To reduce the file size of images by grouping similar pixels.</li></ul><p>3. <strong>Anomaly Detection</strong></p><ul><li><strong>Objective</strong>: To identify unusual patterns or outliers in data.</li></ul><p>4. <strong>Recommendation Systems</strong></p><ul><li><strong>Objective</strong>: To improve product recommendations based on user preferences.</li></ul><p>5. <strong>Genomics and Bioinformatics</strong></p><ul><li><strong>Objective:</strong> To group genes or proteins with similar expression patterns or functions.</li></ul><p>6.<strong> Healthcare and Patient Diagnosis</strong></p><ul><li><strong>Objective</strong>: To categorize patients based on medical conditions or treatment responses</li></ul><h3>Conclusion</h3><p>K-Means Clustering is a fundamental and powerful unsupervised learning algorithm widely used in various fields. Its simplicity and efficiency make it a popular choice for clustering tasks, though it has some limitations regarding the number of clusters and the shape of clusters. By understanding and implementing K-Means Clustering, you can gain valuable insights from data, segment customers, detect anomalies, and much more.</p><p>Whether you are working on marketing strategies, image processing, or healthcare data, K-Means Clustering provides a robust method to uncover hidden patterns and group similar data points, ultimately aiding in better decision-making and improved outcomes.</p><h3>Call to Action: Apply K-Means to Your Projects and Share Your Experiences</h3><p>I hope this blog has given you a clear understanding of the K-Means Clustering Algorithm and how it can be applied to various real-world scenarios. Now, it’s your turn to put this knowledge into practice!</p><p>I encourage you to apply K-Means Clustering to your own projects and see the insights you can uncover. Whether you’re working on customer segmentation, image compression, or any other clustering task, this algorithm can be a valuable tool in your machine learning toolkit.</p><p>Feel free to share your experiences, challenges, and successes in the comments section below. If you have any questions or need further clarification, don’t hesitate to ask. Let’s learn and grow together!</p><h3>References</h3><ul><li><strong>BitByte Summer of ML</strong>: An educational program held by The Programming Club of IIIT Jabalpur that offers comprehensive tutorials and projects on machine learning, including the K-Means Clustering Algorithm.</li><li>Medium Blogs: Various articles on Medium that provide insights, tutorials, and practical examples of the K-Means Clustering Algorithm.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*lrBrvgzsxzmuzHb__j2bRA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a321e1c81d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>