Top "K-means" questions

In statistics and data mining, k-means clustering is a method of cluster analysis which aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean (least squares).

How to set k-Means clustering labels from highest to lowest with Python?

I have a dataset of 38 apartments and their electricity consumption in the morning, afternoon and evening. I am trying to …

python sorting numpy scikit-learn k-means
Why doesn't k-means give the global minima?

I read that the k-means algorithm only converges to a local minima and not to a global minima. Why is …

cluster-analysis gradient data-mining k-means convergence
Predicting Values with k-Means Clustering Algorithm

I'm messing around with machine learning, and I've written a K Means algorithm implementation in Python. It takes a two …

python machine-learning data-mining k-means prediction
Kmeans matlab "Empty cluster created at iteration 1" error

I'm using this script to cluster a set of 3D points using the kmeans matlab function but I always get …

matlab cluster-analysis k-means
How to specify distance metric while for kmeans in R?

I'm doing kmeans clustering in R with two requirements: I need to specify my own distance function, now it's Pearson …

r cluster-analysis k-means
Spherical k-means implementation in Python

I've been using scipy's k-means for quite some time now, and I'm pretty happy about the way it works in …

python scipy k-means
ValueError: Number of labels is 1. Valid values are 2 to n_samples - 1 (inclusive) when using silhouette_score

I am trying to calculate silhouette score as I find the optimal number of clusters to create, but get an …

python pandas machine-learning scikit-learn k-means
how to choose initial centroids for k-means clustering

I am working on implementing k-means clustering in Python. What is the good way to choose initial centroids for a …

python cluster-analysis data-mining k-means centroid
Clustering words into groups

This is a Homework question. I have a huge document full of words. My challenge is to classify these words …

cluster-analysis k-means text-analysis
Reveal k-modes cluster features

I'm performing a cluster analysis on categorical data, hence using k-modes approach. My data is shaped as a preference survey: …

scikit-learn k-means categorical-data