Skip to main content

K-Means Clustering Algorithm and K-Medoids Clustering Algorithm

K-Means Clustering Algorithm and K-Medoids clustering

K-Means Clustering Algorithm 

K-Means Clustering is an unsupervised learning algorithm that is used to solve the clustering problems in machine learning or data science. In this topic, we will learn what is K-means clustering algorithm, how the algorithm works, along with the Python implementation of k-means clustering.

What is K-Means Algorithm?

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.

It is an iterative algorithm that divides the unlabeled dataset into k different clusters in such a way that each dataset belongs only one group that has similar properties.

It is a centroid-based algorithm, where each cluster is associated with a centroid. The main aim of this algorithm is to minimize the sum of distances between the data point and their corresponding clusters.

The algorithm takes the unlabeled dataset as input, divides the dataset into k-number of clusters, and repeats the process until it does not find the best clusters. The value of k should be predetermined in this algorithm.

The k-means clustering algorithm mainly performs two tasks:

-Determines the best value for K center points or centroids by an iterative process.

-Assigns each data point to its closest k-center. Those data points which are near to the particular k-center, create a cluster.

Hence each cluster has data points with some commonalities, and it is away from other clusters. 

The below diagram explains the working of the K-means Clustering Algorithm:

K-Medoids clustering-

K-Medoids and K-Means are two types of clustering mechanisms in Partition Clustering. First, Clustering is the process of breaking down an abstract group of data points/ objects into classes of similar objects such that all the objects in one cluster have similar traits. , a group of n objects is broken down into k number of clusters based on their similarities.

Two statisticians, Leonard Kaufman, and Peter J. Rousseeuw came up with this method. This tutorial explains what K-Medoids do, their applications, and the difference between K-Means and K-Medoids.

K-medoids is an unsupervised method with unlabelled data to be clustered. It is an improvised version of the K-Means algorithm mainly designed to deal with outlier data sensitivity. Compared to other partitioning algorithms, the algorithm is simple, fast, and easy to implement.

K-Medoids:

Medoid: A Medoid is a point in the cluster from which the sum of distances to other data points is minimal.

(or)

A Medoid is a point in the cluster from which dissimilarities with all the other points in the clusters are minimal.

Instead of centroids as reference points in K-Means algorithms, the K-Medoids algorithm takes a Medoid as a reference point.

There are three types of algorithms for K-Medoids Clustering:

1.PAM (Partitioning Around Clustering)

2.CLARA (Clustering Large Applications)

3.CLARANS (Randomized Clustering Large Applications)


Read More-

  1. Data Warehouse and Data Mining All Chapter Notes
  2. What Is Data Warehouse
  3. Applications of Data Warehouse, Types Of Data Warehouse
  4. Architecture of Data Warehousing
  5. Difference Between OLTP And OLAP
  6. Python Notes

Comments

Popular posts from this blog

The Latest Popular Programming Languages in the IT Sector & Their Salary Packages (2025)

Popular Programming Languages in 2025 The IT industry is rapidly evolving in 2025, driven by emerging technologies that transform the way businesses build, automate, and innovate. Programming languages play a vital role in this digital revolution, powering everything from web and mobile development to artificial intelligence and cloud computing. The most popular programming languages in today’s IT sector stand out for their versatility, scalability, and strong developer communities. With increasing global demand, mastering top languages such as Python, Java, JavaScript, C++, and emerging frameworks ensures excellent career growth and competitive salary packages across software development, data science, and IT engineering roles. 1. Python Python stands as the most versatile and beginner-friendly language, widely used in data science, artificial intelligence (AI), machine learning (ML), automation, and web development . Its simple syntax and powerful libraries like Pandas, ...

Why Laravel Framework is the Most Popular PHP Framework in 2025

Laravel In 2025, Laravel continues to be the most popular PHP framework among developers and students alike. Its ease of use, advanced features, and strong community support make it ideal for building modern web applications. Here’s why Laravel stands out: 1. Easy to Learn and Use Laravel is beginner-friendly and has a simple, readable syntax, making it ideal for students and new developers. Unlike other PHP frameworks, you don’t need extensive experience to start building projects. With clear structure and step-by-step documentation, Laravel allows developers to quickly learn the framework while practicing real-world web development skills. 2. MVC Architecture for Organized Development Laravel follows the Model-View-Controller (MVC) architecture , which separates application logic from presentation. This structure makes coding organized, easier to maintain, and scalable for large projects. For students, learning MVC in Laravel helps understand professional ...

Data Mining Weka Software- 4 types of working in weka software

Weka Software Weka Software- Weka software are used for calculating result with different condition in  data mining . The weka software is play important role in industry, That software are open source and gives great graphical user interface to user. That software are basically Java based customized tool. The weka software are mainly used in machine learning programs for calculating a different task. In weka software including lots of data mining algorithms for performing a different task.  Weka software gives four types of GUI for work-  1. Simple CLI- It gives simple command line interface that allows direct execution of commands.  2. Explorer-It is an environment for exploring data means display data to user in different format.  3. Experimenter-That section for performing experiment and conducting statistical test between learning schema. In that stage execution of algorithm are perform.  4. Knowledge Flow-It is J...