International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 186 - Number 40 |
Year of Publication: 2024 |
Authors: Ahmad Farhan AlShammari |
10.5120/ijca2024923990 |
Ahmad Farhan AlShammari . Implementation of Clustering using K-Means in Python. International Journal of Computer Applications. 186, 40 ( Sep 2024), 12-17. DOI=10.5120/ijca2024923990
The goal of this research is to develop a clustering program using k-means method in Python. Clustering helps to divide data into clusters (or groups) based on their features. K-means is used to assign the data points to the cluster of the closest center. Euclidean distance is used to measure the distances between the data points and the centers. K-means is an iterative method that continues in processing to update the centers until the final clusters are obtained. The basic steps of clustering using k-means are explained: preparing data, initializing centers, computing labels (computing distances, finding minimum distance, and assigning labels), computing clusters, computing error function, updating centers, and plotting clusters. The developed program was tested on an experimental dataset. The program successfully performed the basic steps of clustering using k-means and provided the required results.