All Questions
Tagged with clustering k-means
744 questions
27
votes
4
answers
60k
views
Estimating the most important features in a k-means cluster partition
Is there a way to determine which features / variables of the dataset are the most important / dominant within a k-means cluster solution?
3
votes
2
answers
2k
views
Bisecting K-means using Dynamic Time Warping
I'm trying to cluster time series of different length and I came up to an idea to use DTW as a similarity measure, which seems to be adequate, but the thing is, I cannot use it with K-means, since it'...
1
vote
1
answer
286
views
How can we compute the difference between two silhouette scores for the same dataset?
Given a dataset X on which I applied k-means and I computed the Silhouette Index score. I consider this score as the truth. I applied again k-means on X and I computed the Silhouette Index score. My ...
2
votes
1
answer
1k
views
Combine two k-means models for better results
I am clustering some pretty fuzzy data with a special k-means like algorithm (a change of algorithm is not an option). Due to random initialization of cluster centers and the fuzziness of the data the ...
2
votes
0
answers
290
views
Update centroids in minibatch K-Means
I wish to know about the operation of minibatch KMeans through a very simple algorithm. The aim of this post is to know how should one update centers in minibatch KMeans. I intend to integrate ...
4
votes
1
answer
431
views
Cluster analysis without knowing the structure of the data set
I’m working on a task regarding cluster analysis for about half a year now, but since the fields of pattern recognition and cluster analysis are quite complex ones, I would call myself a beginner in ...
3
votes
2
answers
4k
views
What is the mathematical definition of the 'Elbow Method'?
In K-means algorithm, it is recommender to pick the optimal K, according to the Elbow Method. However all the tutorials explain the elbow method in these 4 steps:
Run K-means for a range of K's
...
3
votes
1
answer
59
views
mean and least error on the line
Suppose I have a line on which i have points in non-decreasing order. My intuition tells me that if I want to minimize the squared mean error on some subset of 3 (or other number) points, I would like ...
0
votes
0
answers
240
views
K-means clustering and splitting further
I have a problem with my current project. The goal is to create clusters of customers with homogenous properties. So, each cluster should contain a group of customers with similar attributes.
I ...
0
votes
0
answers
181
views
Why is it wrong to apply k-means to a distance matrix?
There are several threads discussing clustering analysis of a distance matrix and they dismiss use of the k-means algorithm. Here are two examples:
Perform K-means (or its close kin) clustering with ...
3
votes
1
answer
2k
views
k-means clustered data: how to label newly incoming data
I have a data set with labels that were produced by a k-means clustering algorithm. Now there is some data (with the same data structure) from another source and I wonder what is the most sensible way ...
0
votes
1
answer
489
views
K-Means clustering - upper bound for number of iterations
Suppose we run the K-means clustering algorithm on a one-dimensional dataset, i.e. $p = 1$, so that each observation consists of a single real number.
We assume that these real numbers are distinct.
...
0
votes
0
answers
405
views
KMeans where there are clusters of data with different densities
Suppose we have $n$ data samples and they are grouped in two sets such that half of the data are in a high density region and the other half is in a low density region. These regions are apart from ...
2
votes
2
answers
2k
views
Why is the clustering cost function called "distortion"?
Andrew Ng's excellent ML course on Coursera describes the k-means clustering algorithm and its cost function (roughly, the points' distance from their cluster centre), which he says is called "...
5
votes
1
answer
19k
views
How to interpret the clusplot in R
I have plotted the Bivariate Cluster Plot (of a Partitioning Object) using the clusplot from the cluster package. Following is ...
2
votes
2
answers
72
views
How to make clusters (consisting of demands) equal to the load of a truck?
I am working on a routing problem where I have thousands of points (places) with individual demands (in Weight and Volume).
So far I have created 5 clusters based on their location. Now I need to ...
1
vote
1
answer
159
views
Discussing validity of tests performed after a cluster analysis
I'm new to datascience (from a medical/medical science background).
My supervisor (social sciences background) asked me to assist in rewriting a paper where we do a cluster analysis for a ...
2
votes
1
answer
283
views
K-means random initialization: two centers at same point
I'm wondering how k-means deals with randomly initializing two centers (for two distinct observations x_1 and x_2, but with the ...
2
votes
1
answer
5k
views
Does the average distance in K-means have to be monotone decreasing?
I'm implementing the k-means algorithm myself. I don't see any obvious mistake in my code and it seems to work well. However, there's something I don't understand.
My algorithm, working on vectors $...
0
votes
1
answer
193
views
How can one compute the "average" of a dataset of histograms that minimizes the mean Earth Mover's Distance between all data points and average?
It is my understanding that when the distance metric is euclidean distance, the mean of a dataset minimizes the average distance between all data points and the computed "mean".
In the case ...
1
vote
0
answers
15
views
Clustering algorithm which is guaranteed to converge to global minimum [duplicate]
Well known k-means algorithm is not guaranteed to converge to global minimum. It only converges to local minimum.
So my question is, what are the clustering algorithms that are guaranteed to converge ...
0
votes
0
answers
78
views
The total within sum of squares gradually decreases in K-means algorithm
Show that for K-means algorithm,
$ \sum_{k=1}^K \sum_{i \in C_k} d(X_i,\bar{X_k}) \ge \sum_{j=1}^K \sum_{i \in C_j^\prime} d(X_i,\bar{X_j^\prime})$,
where d is the squared Euclidean distance,$\bar{X_k}...
2
votes
1
answer
503
views
Can the k-nearest neighbor algorithm tell you how many clusters there are among predictors?
I recently did a short course on machine learning in R and found the k-means and k-nearest neighbor techniques extremely interesting.
Forgive my naivete if this is all wrong, but it seems like the ...
2
votes
0
answers
158
views
How to perform cluster analysis on categorial data in R
I have survey data with 1000 respondents, each one has awnsered 20 questions related to different product features of a car. Each question could be awnsered as "good", "indifferent"...
1
vote
1
answer
1k
views
How to assess the consistency of clustering
I am solving a clustering problem in which I am running the same algorithm 50 times. I know several scores aimed to select the best k, but I was wondering if there exist any score that measures the ...
2
votes
2
answers
968
views
Need a little help understanding K-means++ seeding
I have been working on a project that involves using K-means clustering for generating adaptive palettes from images. I understand the general process of K-means clustering, and I understand the ...
0
votes
1
answer
122
views
Weighting k-means with two attributes
I am aiming to use K-means to cluster lat-lon points, but I want to apply a weight to each point's distance based on two attributes of the point.
Attribute 1 is population and attribute 2 is percent ...
1
vote
1
answer
512
views
How do I analyze clustering post-PCA
I had in mind to cluster stocks based on some risk indicators such as VaR, sharpe ratio or variance. In a first instance I was thinking to cluster those data points and analyze the results, because ...
1
vote
1
answer
43
views
Does this shape one cluster? and why angles change every time i run the code?
I have data and tried to do clustering on it. every time I run the code with the below statements it changes the angle of the shape but still the same below shape
...
2
votes
1
answer
926
views
Interpretation of Cluster Distortion on Normalized data
I have a clustering problem which I solved using KMeans clustering. I also know that the Elbow Method for cluster evaluation can be used to approximate a feasible pick for the number of clusters.
I ...
4
votes
0
answers
702
views
Clustering text embeddings: TF-IDF + BERT Sentence Embeddings
I am trying to cluster a few thousand forum posts that are similar in content to Stackoverfow.
So far, I have tried two main approaches to represent the posts:
TF-IDF
Sentence embedding based on BERT....
1
vote
2
answers
776
views
Streaming k-means
I want to perform something like streaming/online/out-of-core kmeans clustering on large data.
Here is simple idea:
Break all data into N chunks.
Read from disk 1st chunk and calculate centroids ...
0
votes
0
answers
245
views
Streaming K-medoids
Mahout, Hadoop machine learning library, contains an implementation of Streaming K-means algorithm that is based on the following paperworks The Effectiveness of Lloyd-Type Methods for the k-Means ...
3
votes
2
answers
569
views
Kmeans algorithm cyclical solution
I am currently implementing a Kmeans clustering algorithm in R. I am not using any packages and I wrote it from scratch. I am using only one set of initial guesses, and my action upon finding an empty ...
1
vote
1
answer
96
views
Find all possible clusterizations
I need help to find all possible clusterizations via the k-means method in Python. Let's assume for simplicity that I have the following table:
height | weight | country of origin (X/Y/Z) | flag (1/0)
...
3
votes
2
answers
4k
views
Clustering data based on regression coefficients
Context: In my master thesis, I am examining the evolution of maintainability issues over time on a set of around 2000 Android applications. For every application in the dataset, I have the counts of ...
22
votes
4
answers
39k
views
k-means implementation with custom distance matrix in input
Can anyone point me out a k-means implementation (it would be better if in matlab) that can take the distance matrix in input?
The standard matlab implementation needs the observation matrix in input ...
1
vote
1
answer
805
views
How to avoid k-means to merge two groups of points into one cluster?
I've implemented a k-means clustering algorithm, but in some cases (~12%) a situation like that happened:
In these cases, my algorithm is creating one cluster for both the yellow and blue group of ...
3
votes
1
answer
2k
views
Acceptable SSE (sum of squared errors) for K-means
I am developing a k-means clustering algorithm, and I have obtained the ideal number of clusters based on the elbow method. However, despite the fact that the error diminishes a lot with the number of ...
58
votes
3
answers
116k
views
Clustering a long list of strings (words) into similarity groups
I have the following problem at hand: I have a very long list of words, possibly names, surnames, etc. I need to cluster this word list, such that similar words, for example words with similar edit (...
0
votes
1
answer
124
views
KNN and K-means, very different but possible equivalency?
Why does the k-nearest neighbor algorithm and k-means clustering algorithm with $k=1$ act the same?
7
votes
2
answers
5k
views
Finding the cluster centers in kernel k-means clustering
I think this is the most easily understood topic in Kernel K Means Clustering. But assuming that I am not an expert in Machine Learning, can someone tell me how does someone calculate Kernel K means ...
0
votes
1
answer
2k
views
Elbow method gives very different number of clusters than Silhouette method in kmeans
I am trying to cluster tweets using k means algorithm. In order to find the best number of clusters I run the elbow method and the Silhouette method for 1 to 14 clusters. However, the elbow method ...
0
votes
0
answers
99
views
How to make 65 clusters ? Is k-mean good algorithm to do this?
I am trying to segment customers based on demographic, behavioral, lifestyle etc into 60-65 segments inline with Claritas Prizm segments Link1 Link2
I have 1 million records and 264 variables. ...
1
vote
1
answer
995
views
How to perform Normalization on Call Details Record to perform k-Mean Clustering
I'm new to data mining and currently doing mining project on telecom customer segmentation (based on profile and call details record). I have gender, age, call time and call duration and have to ...
1
vote
1
answer
1k
views
Customer behavior analysis and clustering using data from loyalty program?
I'm trying to do some analysis on customers behavior. Basically, I have information on customer's loyalty points activities data (e.g. how many points they have earned, how many points they have used, ...
1
vote
1
answer
49
views
Using k-means to segment customers in the positive class
I have some labeled data (0=didn’t cancel, 1=canceled) that I am creating a model for in my marketing class.
On top of predicting who is likely to cancel, I’d like to explore the possibility of ...
2
votes
3
answers
4k
views
Repeating k-means, is it helpful?
I'm working with k-means algorithm, and I'm proceeding in this way:
I've run k-means from 2 to n clusters, I plotted the k-means result of the variance, to get the "elbow", to decide the ...
2
votes
1
answer
668
views
Market / Customer Segmentation - Merging two different segmentations
I have a database where each observation is a person. They were questioned on their attitude towards the consumption of X category of product. I have being using K-means to segment this data.
I have ...
4
votes
1
answer
3k
views
Why is k-medians typically used with Manhattan rather than Euclidean distance?
K-medians is typically used with Manhattan distance rather than Euclidean distance. Why is this?