By the end of this article, you’ll understand the inner working of the k-means clustering algorithm and will be able to implement it on your own.

What is k-means clustering?

K-means clustering is an unsupervised machine learning algorithm used to find groups in a dataset. The objective of k-means clustering is to divide a dataset into groups (clusters) of similar items.

To use k-means clustering you need to provide a dataset and a number value for “k”:

k = 3
result = kmeans(dataset, k)

The “k” in k-means is the number of groups that you want to divide the dataset in. In the example…


Machine Learning is immensely popular nowadays, influencing what content we see, what products we buy, who gets a mortgage approved and who doesn’t. But how does it work?

By the end of the article, you will have an understanding of how a machine like a computer can learn. The focus of this article is to develop an intuition to the inner workings of Machine Learning. Not focusing on any particular algorithm, but the intuition behind them.

Photo by Ramón Salinero on Unsplash

Machine learning and Artificial intelligent tackle numerous problems. Here I will focus on one of the most common and popular problems. Classification.

Classification is…

Paulo Silva

Machine Learning. Developer. How do we go from data to knowledge? And from knowledge to wisdom?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store