Skip to main content
Search by keyword

k-Means algorithm for data clustering

k-Means algorithm for data clustering

Interested in learning more about k-means clustering in Python? This tutorial will take you through the basics of clustering, take you step-by-step through the k-means clustering in Python, and will help you establish if this method of clustering is best suited for your problem. 

    What is clustering? 

    Before diving into k-means clustering, it’s important to cover the basics of clustering and the different algorithms. Clustering is a method of dividing data into groups (or clusters!). These clusters can therefore be defined as groups of ‘data objects’. Through clustering, you can identify if that data that is meaningful (which expand domain knowledge) or useful (intermediate step in a data pipeline). To help cover the foundational knowledge needed to understand k-means clustering, this tutorial breaks down the 3 most-known categories of clustering algorithms:

    • Partitional (divides data objects into nonoverlapping groups)
    • Hierarchical (determines cluster assignments by building a hierarchy)
    • Density-based (determines cluster assignments based on the density of data points in the region)

    k-means

    While there are many types of clustering methods, the k-means is considered one of the most approachable: it’s an unsupervised machine learning technique used to identify clusters of data objectives in a dataset. Using concrete real-world examples, this comprehensive tutorial by Real Python will help you to:

    • Define k-means clustering
    • Explain when you should use k-means clustering to analyse data
    • Choose the appropriate number of clusters 
    • Implement k-means clustering in Python with Scikit-Learn 
    • Evaluate clustering performance of algorithms
    • Build and tune a k-means clustering pipeline in Python
    • Analyse clustering results from the k-means algorithm

    Get started!

    Ready to get started with k-means algorithm? Start the tutorial!  
     

    Learning content

    Target audience
    Digital skills for ICT professionals and other digital experts.
    Digital skills in education.
    Digital skill level
    Geographic scope - Country
    Austria
    Belgium
    Bulgaria
    Cyprus