Tag Info

Hot answers tagged

4

K-means is only randomized in its starting centers. Once the initial candidate centers are determined, it is deterministic after that point. Depending on your implementation of kmeans the centers can be chosen the same each time, similar each time, or completely random each time. With MATLAB/R implementations, the choice is random but the result you get is ...


3

There is more than one k-means algorithm. You probably refer to Lloyds algorithm, which only depends on the initial cluster centers. But there also is MacQueen's, which depends on the sequence i.e. ordering of points. Then there is Hartigan, Wong, Forgy, ... And of course, various implementations may have implementation and optimization differences. They ...


2

First of all: yes: standardization is a must unless you have a strong argument why it is not necessary. Probably try z scores first. Discrete data is a larger issue. K-means is meant for continuous data. The mean will not be discrete, so the cluster centers will likely be anomalous. You have a high chance that the clustering algorithms ends up discovering ...


2

DBSCAN and OPTICS should work with asymmetric distances as well. Don't use the DBSCAN implementation in R. It's incredibly slow. The version in scipy probably doesn't allow you to use arbitrary distances, and it computes the full distance matrix, so it scales badly. The DBSCAN and OPTICS implementations in ELKI are pretty good, and scale really well when ...


2

Well, mathematically, k-means clusters are not spherical, but Voronoi cells. However, the claim is not invalid, as the actual data usually does not fill the whole cell, but if you'd take the convex hull of the data it indeed is somewhat spherical in nature. The reason probably is that when minimizing variance (and k-means minimizes the in-cluster variance, ...


2

It sounds like a two component gaussian mixture model would be exactly what you're looking for. I don't tend to use R, but GMMs are so commonly used I can't imagine it they're not implemented somewhere. If you really can't find them anywhere then they're not too hard to implement yourself. Wikipedia has the exact expectation maximisation update steps ...


2

Within-cluster-variance is a simple to understand measure of compactness (there are others, too). So basically, the objective is to find the most compact partitioning of the data set into $k$ partitions. K-Means, in the Lloyd version, actually originated from 1d PCM data as far as I know. So assuming you have a really bad telephone line, and someone is ...


1

There are several questions here at very different levels. In essence every text on cluster analysis is an answer. You have to keep reading! Variance is at one level just one statistical standard which statistical people find convenient to think about. Roughly, minimising variance encourages -- nay, enforces -- clusters as relatively tight balls. What can ...


1

k-means++ is not meant to improve the accuracy. What k-means++ is meant to improve is the starting conditions, making k-means to be more likely to converge to a reasonably good local optimum, and faster than with random initialization; largely by ensuring that the cluster centers are not too close to each other initially. Still, k-means++ means to preserve ...


1

I see k-means++ more of a way to initialize your clustering. Meaning how to design your initial cluster centers. There are a number of indices that can give you a better idea of how to decide on an "optimal k" than just the within groups sum of squares. For example the calinski-harabasz index is easy to understand yet many times yields good results: ...


1

First of all, your data is too extreme, and not at all realistic. There are 100 variables Each variables is equal to 1 with probability 0.01 This means that most vectors will have a single 1. Many will be 0. Some will have more than one. Try more complex patterns, and more complex data. Try to estimate the parameters from real data, for example. Or just ...


1

You don't need to change anything in the main part of the code. First, get the outputs, in which ever order they are. For making the new plots' cluster numbers same as the previous ones, you can write a function such that the new centroids which are closer to the older centroids are re-assigned to the cluster number of the older centroids. First compute the ...


1

It would probably make more sense if you also estimated the "height" (actually, more of a weight) of both, and then set the threshold to the tipping point. I.e. model the data as $$p_1 \cdot pdf(x, \mu_1, \sigma_1) + p_2 \cdot pdf(x, \mu_2, \sigma_2)$$ and set the threshold to $x$ where $$p_1 \cdot pdf(x, \mu_1, \sigma_1) = p_2 \cdot pdf(x, \mu_2, ...


1

Here are references for a graph theoretic / social networks approach to clustering: Guimera , R., Sales-Pardo, M., Amaral, L. (2004). Modularity From Fluctuations In Random Graphs and Complex Networks. Physical Review E. 70 (2), 025101 Reichardt, J., and Bornholdt, S. (2006). Statistical Mechanics of Community Detection, Phys. Rev. E, 74, 016110 ...


1

It seems that you have an unlabeled data set. The F1 score requires that you compare your experiment's results with actual results (i.e., count false positives and negatives). If you don't have any "correct" results against which to compare, you won't be able to calculate a F1 score. To calculate Precision/Recall in an unsupervised approach, you need ...


1

You are trying to determine an appropriate distance measure, and clearly you are noticing how tricky this can be. Ordinal data is not interval data. You should consider: whether the distance between each category is the same (is the distance between 2 and 3 the same as the distance between 3 and 4?) whether special consideration needs to be given to the ...


1

You might be interested in correspondence analysis, which is supposed to be a categorical version of PCA. In R, these are implemented in, for example, the packages ade4 and FactoMineR. Have you tried making a dendogram of your data? This might give you a way to eyeball the number of clusters.


1

As no one has pointed it yet, I thought I would share this. There is a method called X-means, (see this link) which estimates proper number of clusters using Bayesian information criterion (BIC). Essentially, this would be like trying K means with different Ks, calculating BIC for each K and choosing the best K. This algorithm does that efficiently. There ...


1

In hierarchical clustering the number of output partitions is not just the horizontal cuts, but also the non horizontal cuts which decides the final clustering. Thus this is can be seen as a third criterion aside the 1. distance metric 2. Linkage criterion. http://en.wikipedia.org/wiki/Hierarchical_clustering The criterion you have mentioned is a 3rd kind ...



Only top voted, non community-wiki answers of a minimum length are eligible