2022 Developer Survey is open! Take survey.

# Tag Info

Accepted

### K-Means clustering for mixed numeric and categorical data

The standard k-means algorithm isn't directly applicable to categorical data, for various reasons. The sample space for categorical data is discrete, and doesn't have a natural origin. A Euclidean ...
• 3,020

### Clustering geo location coordinates (lat,long pairs)

K-means is not the most appropriate algorithm here. The reason is that k-means is designed to minimize variance. This is, of course, appearling from a statistical and signal procssing point of view, ...

### K-Means clustering for mixed numeric and categorical data

In my opinion, there are solutions to deal with categorical data in clustering. R comes with a specific distance for categorical data. This distance is called Gower and it works pretty well.
• 583

### K-Means clustering for mixed numeric and categorical data

(In addition to the excellent answer by Tim Goodman) The choice of k-modes is definitely the way to go for stability of the clustering algorithm used. The clustering algorithm is free to choose any ...
• 1,293
Accepted

### Confused about how to apply KMeans on my a dataset with features extracted

For clustering, your data must be indeed integers. Moreover, since k-means is using euclidean distance, having categorical column is not a good idea. Therefore you should also encode the column ...
• 1,631

### K-Means clustering for mixed numeric and categorical data

This question seems really about representation, and not so much about clustering. Categorical data is a problem for most algorithms in machine learning. Suppose, for example, you have some ...
• 577
Accepted

### How to measure the similarity between two images?

Check this handout! Well, there a few so... lets go: Given two images $J[x,y]$ and $I[x,y]$ with $(x,y) \in N^{N \times M}$... A - Used in template matching: Template Matching is linear and is not ...
Accepted

### K-means: What are some good ways to choose an efficient set of initial centroids?

An approach that yields more consistent results is K-means++. This approach acknowledges that there is probably a better choice of initial centroid locations than simple random assignment. ...
Accepted

### How to get the probability of belonging to clusters for k-means?

Let us briefly talk about a probabilistic generalisation of k-means: the Gaussian Mixture Model (GMM). In k-means, you carry out the following procedure: - specify k centroids, initialising their ...
• 1,037
Accepted

### Clustering high dimensional data

I don't think any of the clustering techniques "just" work at such scale. The most scalable supposedly is k-means (just do not use Spark/Mahout, they are really bad) and DBSCAN (there are some good ...
Accepted

### K-means vs. online K-means

Online k-means (more commonly known as sequential k-means) and traditional k-means are very similar. The difference is that online k-means allows you to update the model as new data is received. ...
• 1,160
Accepted

### Fast k-means like algorithm for $10^{10}$ points?

k-means is based on averages. It models clusters using means, and thus the improvement by adding more data is marginal. The error of the average estimation reduces with 1/sqrt(n); so adding more data ...
Accepted

### Clustering for multiple variable

K-means Your data has $7$ dimensions so k-means is worth to try. See the PCA of your data and check if any cluster is visible there as K-means will have a tough time if clusters are not Gaussian. the ...
• 6,277
Accepted

### Clustering geo location coordinates (lat,long pairs)

K-means should be right in this case. Since k-means tries to group based solely on euclidean distance between objects you will get back clusters of locations that are close to each other. To find the ...
• 913

### Clustering for mixed numeric and nominal discrete data

Taking a stab: I am trying to identify a clustering technique with a similarity measure that would work for categorical and numeric binary data. Gower Distance is a useful distance metric when the ...
Accepted

### K-Means vs hierarchical clustering

I would say hierarchical clustering is usually preferable, as it is both more flexible and has fewer hidden assumptions about the distribution of the underlying data. With k-Means clustering, you ...
• 2,108
Accepted

### How to evaluate the K-Modes Clusters?

The are some techniques to choose the number of clusters K. The most common ones are The Elbow Method and The Silhouette Method. Elbow Method In this method, you ...
• 3,258

### Clustering geo location coordinates (lat,long pairs)

I am probably very late with my answer, but if you are still dealing with geo clustering, you may find this study interesting. It deals with comparison of two fairly different approaches to ...
• 618

### Clustering geo location coordinates (lat,long pairs)

GPS coordinates can be directly converted to a geohash. Geohash divides the Earth into "buckets" of different size based on the number of digits (short Geohash codes create big areas and longer codes ...
• 16.3k

### For which real world data sets does DBSCAN surpass K-means.?

I play around quite a bit with location data and have found examples both where k-means works fine and where k-means is a poor representation and DBSCAN is a great fit. If you've ever gone hiking or ...
• 6,638

### k-means in R, usage of nstart parameter?

nstart option attempts multiple initial configurations and reports on the best one. For example, adding nstart=25 will generate 25 initial random centroids and choose the best one for the algorithm. ...
• 111
Accepted

### Sklearn: unsupervised knn vs k-means

Unsupervised k-NN Unlike k-means, the unsupervised k-nn does not associate a label to instances. All it can do is tell you what instances in your training data is k-nearest to the point you are ...
• 8,478

### Accuracy for Kmeans clustering

Accuracy is a measure of comparing the true label to the predicted label. K-Means is an unsupervised clustering algorithm where a predicted label does not exist. So, accuracy can not be directly ...
• 274

### K-means vs. online K-means

The original MacQueen k-means publication (the first to use the name "kmeans") is an online algorithm. MacQueen, J. B. (1967). "Some Methods for classification and Analysis of Multivariate ...

### K-Means clustering for mixed numeric and categorical data

It depends on your categorical variable being used. For ordinal variables, say like bad,average and good, it makes sense just to use one variable and have values 0,1,2 and distances make sense here(...
• 349

### K-Means clustering for mixed numeric and categorical data

You should not use k-means clustering on a dataset containing mixed datatypes. Rather, there are a number of clustering algorithms that can appropriately handle mixed datatypes. Some possibilities ...

### K-means incoherent behaviour choosing K with Elbow method, BIC, variance explained and silhouette

Just posting a summary of above comments and some more thoughts so that this question is removed from "unanswered questions". Image_doctor's comment is right that these graphs are typical for k-means....

### K-means incoherent behaviour choosing K with Elbow method, BIC, variance explained and silhouette

Finding the elbow can be made more easier by computing the angles between the consecutive segments. Replace your: kIdx = 10-1 with: ...
• 71