# Introduction to Clustering

Welcome to this introduction to clustering. While most machine learning algorithms we have covered belong to the supervised learning group, clustering algorithms are unsupervised learning algorithms. Unsupervised because we do not have labels on our data and we want an algorithm to give us insight regardless.

Here is an example: Say we have a bunch of customer data such as age, gender, location and which products they bought, but we don’t want to predict anything in particular about these people. Instead, we can then use an unsupervised clustering algorithm to create customer segments by dividing the data into clusters. We may find a group of very good customers that we should take care of, along with a group of bad customers that we can safely pay less attention to. Because of this, clustering algorithms are widely used across industries such as retail, banking, manufacturing, healthcare, etc.

The algorithms can be used on structured data such as tabular data, as well as on unstructured data such as images, text and audio. Clustering is often used to organize vast amounts of data.

In this guide, you will learn about clustering algorithms and how to apply them to a data set.

## Most Common Clustering Algorithms

Let’s go through some of the most common and best algorithms used for clustering today:

• K Means
• Mean Shift

### K Mean Clustering

There are several straight forward clustering algorithms but K Means is surely one of the simplest.
The goal of the algorithm is to separate the data into K clusters. The algorithm will iteratively assign clusters to each of the data points based on numerical similarities of the features. Ultimately, the output of the clustering will be two things: Centroid coordinates for each of the clusters and labels for all the data points.

Because of this simplicity, K Means is one of the fastest clustering algorithms out there. However, K means will fail if it finds a local minimum and it is therefore preferred to randomly initialize the algorithm several times to ensure convergence.