K-means Clustering › Computational Considerations

Michael BrenndoerferAugust 2, 20251 min read
Machine Learning from ScratchAll chapters
Part 7 of 9Unsupervised Learning
Chapter 53K-means Clustering › Computational Considerations
Reading section 12 of 15 · Computational Considerations · 1 minSection 12 of 15 · 1 min

Book contents

Section 12 of 15 · 1 min read

K-means Clustering › Computational ConsiderationsOne section · Sections in this chapter12 / 15 ↓

K-means clustering has a time complexity of O(nkt), where n is the number of data points, k is the number of clusters, and t is the number of iterations until convergence. For large datasets (typically >100,000 points), consider sampling strategies or use Mini-Batch K-means to make the algorithm computationally feasible. The algorithm's memory requirements are generally modest, but for very large datasets, consider using sparse representations or chunking strategies to manage memory usage effectively.