# Tag Info

4

Wang, Kaijun, Baijie Wang, and Liuqing Peng. "CVAP: Validation for cluster analyses." Data Science Journal 0 (2009): 0904220071.: To measure the quality of clustering results, there are two kinds of validity indices: external indices and internal indices. An external index is a measure of agreement between two partitions where the first ...

3

As said, in the other answer, cluster quality indices can be used for this purpose. More generally, these indices can be used to compare clustering of different number of groups or obtained with different clustering algorithm. In R, these indices are available in the WeightedCluster library. For more informations see here ...

3

One usual way to compare the degree of clustering independently from the dataset size is taking the mean of the silhouette. E.g. in MATLAB you can see the dataset size won't change the mean of the silhouette rng('default'); % For reproducibility for n = 1:100:1000 % Not clustered X = [randn(n,2);randn(n,2)]; cidx = ...

3

One way to assign a weight to a variable is by changing its scale. The trick works for the clustering algorithms you mention, viz. k-means, weighted-average linkage and average-linkage. Kaufman, Leonard, and Peter J. Rousseeuw. "Finding groups in data: An introduction to cluster analysis." (2005) - page 11: The choice of measurement units gives rise to ...

2

I've discovered that the Peto and Peto generalization of the Wilcoxon test fits this purpose. It weights divergence at earlier values of t more than later values. You can use the test statistic as the metric, or the p-value if you need to compare pairs of curves with different sample sizes. This metric has the added bonus of being readily available in R as ...

2

There is no "k-means algorithm". There is MacQueens algorithm for k-means, the Lloyd/Forgy algorithm for k-means, the Hartigan-Wong method, ... There also isn't "the" EM-algorithm. It is a general scheme of repeatedly expecting the likelihoods and then maximizing the model. The most popular variant of EM is also known as "Gaussian Mixture Modeling" (GMM), ...

2

This question calls for a modification of the solution to a sequence counting problem: as noted in comments, it requests a cross-tabulation of co-occurrences of values. I will illustrate a naive but effective modification with R code. First, let's introduce a small sample dataset to work with. It's in the usual matrix format, one case per row. x <- ...

2

One way to quantify the usefulness of each feature (= variable = dimension), from the book Burns, Robert P., and Richard Burns. Business research methods and statistics using SPSS. Sage, 2008. (mirror), usefulness being defined by the features' discriminative power to tell clusters apart. We usually examine the means for each cluster on each dimension ...

2

From what you say it sounds like you want to use igraph and find groups of individuals using moduarity, you can look here for details. e.g. dat <- structure(list(ID = structure(1:4, .Label = c("A", "B", "C", "D"), class = "factor"), A = c(2L, 2L, 0L, 0L), B = c(2L, 2L, 0L, 0L), C = c(0L, 0L, 2L, 1L), D = c(0L, 0L, 1L, 2L)), .Names = c("ID", "A", "B", ...

1

Have you looked at stream clustering algorithms? There has been some research on changing data sets, and related challenges such as concept drift. Also, get rid of thinking in k-means terms; more modern clustering algorithms do not have spherical clusters that can be summarized with just a centroid. Thinking of clusters as "centroids" limits your way of ...

1

You can compute the cluster assignments for a new data set with the following function: clusters <- function(x, centers) { # compute squared euclidean distance from each sample to each cluster center tmp <- sapply(seq_len(nrow(x)), function(i) apply(centers, 1, function(v) sum((x[i, ]-v)^2))) ...

1

The usual approach would be to train a classifier on the resulting partitions (if possible, first clean the data, in particular fix any errors in the clustering). There is not much to be gained from mixing clustering and classification/prediction. Use clustering to produce an initial working hypothesis, refine this hypothesis, then use prediction to ...

1

Here is an example, if I were doing this in mplus, which might be helpful and compliment more comprehensive answers: Say I have 3 continuous variables and want to identify clusters based on these. I would specify a mixture model (more specficially in this case, a latent profile model), assuming conditional independence (the observed variables are ...

1

The sound method ... is to ask an expert. There is no objective mathematical criterion. Each has drawbacks. And probably the best criterion is to have an expert say "wow, this is interesting. let me check ... yes, this is right, I didn't know". The reference method If you have annotated data, you can compare the algorithm output to these annotations. This ...

1

Don't drop any variables, but do consider using PCA. Here's why. Firstly, as pointed out by Anony-mousse, k-means is not badly affected by collinearity/correlations. You don't need to throw away information because of that. Secondly, if you drop your variables in the wrong way, you'll artificially bring some samples closer together. An example: Customer ...

1

You may try also a more recent method: A. Kalogeratos and A.Likas, Dip-means: an incremental clustering method for estimating the number of clusters, NIPS 2012. The idea is to use statistical hypothesis testing for unimodality on vectors containing the similarity/distance between one point and the rest of the points of the set. The testing is done using ...

1

Let me emphasize that I'm a newcomer to clustering, and am not sure of the right answer in this case. That said, my first thought would be to fit a logistic model with random effects for family. Here is a tutorial from UCLA statistics on estimating these models in R.

1

To make a statement about the steady state behaviour of each cluster you could compute the steady state distributions of each transition matrix by eigenvectors, then compare box-plots by cluster. You're likely to run into issues in the computation of steady state without applying some sort of smoothing first. How are you clustering the transition matrices? ...

1

The pvclust package calculates p-values for a very specific test in phylogenetics, called the Approximately Unbiased test (Shimodaira, H. An approximately unbiased test of phylogenetic tree selection. Syst. Biol. , 51, 492-508, 2002). This test uses multi-scale bootstrapping of the site-likelihoods obtained from fitting molecular or other data to a set of ...

1

You can use Java Machine Learning Library. They have a K-Means implementation. One of the constructors accepts three arguments K Value. An object of that is an instance of the DistanceMeasure Class. Number of iterations. One can easily extend the DistanceMeasure class to achieve the desired result. The idea is to return values from a custom distance ...

1

Recently I needed this myself for a not very large dataset. My answer, although it has a relatively long running time, is guaranteed to converge to a local optimum. def eqsc(X, K=None, G=None): "equal-size clustering based on data exchanges between pairs of clusters" from scipy.spatial.distance import pdist, squareform from matplotlib import ...

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