Linked Questions

57 votes
11 answers

How to decide on the correct number of clusters?

We find the cluster centers and assign points to k different cluster bins in k-means clustering which is a very well known algorithm and is found almost in every machine learning package on the net. ...
user avatar
  • 1,625
87 votes
6 answers

Why does k-means clustering algorithm use only Euclidean distance metric?

Is there a specific purpose in terms of efficiency or functionality why the k-means algorithm does not use for example cosine (dis)similarity as a distance metric, but can only use the Euclidean norm? ...
user avatar
  • 1,001
25 votes
8 answers

Perform K-means (or its close kin) clustering with only a distance matrix, not points-by-features data

I want to perform K-means clustering on objects I have, but the objects aren't described as points in space, i.e. by objects x features dataset. However, I am able ...
user avatar
  • 253
19 votes
4 answers

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 ...
user avatar
  • 311
17 votes
3 answers

Choosing optimal K for KNN

I performed a 5-fold CV to select the optimal K for KNN. And it seems like the bigger K gets, the smaller the error... Sorry I didn't have a legend, but the different colors represent different ...
user avatar
  • 1,613
11 votes
1 answer

Elbow criteria to determine number of cluster

It is mentioned here that one of the methods to determine the optimal number of clusters in a data-set is the "elbow method". Here the percentage of variance is calculated as the ratio of the between-...
user avatar
  • 4,097
20 votes
1 answer

How to define number of clusters in K-means clustering?

Is there any way to determine the optimal cluster number or should I just try different values and check the error rates to decide on the best value?
user avatar
  • 530
9 votes
3 answers

Using k-means with other metrics

So I realize this has been asked before: e.g. What are the use cases related to cluster analysis of different distance metrics? but I've found the answers somewhat contradictory to what is suggested ...
user avatar
2 votes
2 answers

How to determine optimal number of clusters?

For a multilabel dataset, i would like to find the number of clusters involved in it. The below example gives more details about the problem: ...
user avatar
  • 4,097
0 votes
2 answers

Distance function for categories in K-means

How to define a distance function when euclidean distance doesn't apply? For instance, say I have some data involves nationality. I'll probably assign a number to each nation, but for nations that ...
user avatar
  • 207
-1 votes
1 answer

Determining number of clusters K-means [duplicate]

I would like to automatically determine the number of clusters for K-means. I have read that elbow method could be used for that. The thing that confuses me is - I have to rerun algorithm while ...
user avatar
1 vote
1 answer

How To Determine Number Of Clusters In T-SNE And Best Clustering Algorithm?

I used TSNE method to cluster my DataSet. ...
user avatar