During clustering, what are the advantages of using either the component-wise median or the component-wise mean (centroid).  One of the possible advantages of the component-wise median over the mean may be the robustness to outliers, even if, with a good number of samples, outlier effects don't affect the central point of the cluster.  Are there other advantages for either one or the other alternative?
123666
I know there is k-means clustering algorithm and k-median. One that uses the mean as the center of the cluster and the other uses the median. My question is: when/where to use which?
3508
I am currently using Viterbi training for an image segmentation problem.   I wanted to know what the advantages/disadvantages are of using the Baum-Welch algorithm instead of Viterbi training.
95043
Is there a way to determine which features / variables of the dataset are the most important / dominant within a k-means cluster solution?
27906
If I have a certain dataset, how smart would it be to initialize cluster centers using means of random samples of that dataset?  For example, suppose I want 5 clusters. I take 5 random samples of say, size=20% of the original dataset. Could I then take the mean of each of these 5 random samples and use those means as my 5 initial cluster centers? I don't know where I read this but I wanted to know what you guys think about the idea.    UPDATE: Please see this thread  for the general discussion about the various initialization methods.
64628
What's the best way to find outliers in the time-series, encountering continuity? I attached two time-series that I'm interested to filter. One is less noisy, and one is a bit noisier. I'm mostly interested in the first one. BTW the data looks like it is periodic, however, it is not and it is quite short (200-500 samples). Also, I don't know much about the process Thanks
95158
Suppose, I have a data set with eight features in my hand.  I have juxtaposed their means and medians row by row.              f1       f2        f3        f4        f5        f6        f7        f8 mean      2.5000    0.1868    0.0148    0.2105    0.2088   79.6583    1.0604    0.0091 median    2.5000    0.1826    0.0001    0.0002    0.0000   -0.0000    0.0000   -0.0000   Can we tell anything about the existence of outliers from these information?
96431
What cluster method would be appropriate for a study with 16 variables both categorial and quantitative? It is a repeated measures observational study. I read in a text that k-means would be best if the data was mostly quantitative although I may have interpreted that wrong.  Also, what methods are best for throwing out certain variables prior to performing cluster analysis. I read similar articles to the study I am analyzing, and some opted to do a PCA first, or a discriminant function analysis afterwards to confirm the number of chosen clusters.  Thoughts and comments?
73832
I'm looking into clustering points on a map (latitude/longitude). Are there any recommendations as to a suitable algorithm that is fast and scalable?  More specifically, I have a series of latitude/longitude coordinates and a map viewport. I'm trying to cluster the points that are close together in order to remove clutter.  I already have a solution to the problem (), only I am wondering if there is any formal algorithm that solves the problem efficiently.
15959
Equivalently, about variance?  I realize it measures the spread of a distribution, but many other metrics could do the same (e.g., the average absolute deviation). What is its deeper significance? Does it have    a particular geometric interpretation (in the sense, e.g., that the mean is the balancing point of a distribution)?  any other intuitive interpretation that differentiates it from other possible measures of spread?   What's so special about it that makes it act as a normalizing factor in all sorts of situations (for example, convert covariance to correlation)?
105781
The usual implementation of decision trees, and estimators based on ensembles of decision trees, use decision trees that threshold on a single predictor at each split. So they divide the feature space into perpendicular hyperlanes.  Is there any benefit to generalizing this a tiny bit. So at each split, the decision tree uses 2 features, and thresholds based on whether $ax_1 + bx_2 \ge T$. In other words, the feature space is now getting divided into hyperplanes that are not necessarily perpendicular.   I think the main disadvantages would be:    increased computation, and  overfitting since now using more degrees of freedom   I guess to help both of these issues, randomization could be used analogous to extra trees. The pair of features could be randomly selected, instead of exhaustively trying every pair, and the threshold T and parameters a and b could be chosen randomly as well (perhaps from a set of few discrete values such that the hyperplanes could have a few orientations).  Are there some cases where you think these non-perpendicular decision trees would be an improvement over the regular implementation of various decision tree algorithms?
100986
I had a question  that I got a bunch of great responses on.  I have, hopefully, a quicker question here.  There is a debate in the literature regarding reporting means vs medians in a Wilcoxon-Mann-Whitney test.  See  and also .  I would like to report means in my table, since I only have four possible values (0 through 3), rendering medians less effective as the differences are not pronounced.  If I do report means in the table, would I just put an asterisk saying that means are reported for the Mann-Whitney test because the medians don't show the differences effectively?  I feel like I need to explain why I used means and not medians to describe my ordinal data and show significance (even though a Mann-Whitney is comparing the distributions and not the medians, as some think).  Are there are any references out there that show this as a precedent?  As always, advice/help is greatly appreciated!
118082
I am solving a clustering problem on a trivial dataset with the k-means algorithm. I am running a couple of tests and, from time to time, one centroid doesn't attract any points, i.e. I've got an empty cluster (see the purple "x" in the picture).  What should I do? Shall I delete it or just stop updating its value? Why?    I am aware that built-in functions (e.g., kmeans() in R) have automatic ways of dealing with this situation, but I am trying to write the standard algorithm from scratch. As soon as I fix it I'll be able to compare my results to built-in functions. At this moment I'm looking for some theoretical reasons why I should prefer one solution or another.  In the picture each colour represents a cluster according to the current iteration and each "X" is its centroid (old ones have been kept and marked with the number of the iteration in which they were computed).      [Some related links about empty cluster case, added later by @ttnphns: ; ; ; ; ; ; ; ; ]
97405
I recently read the advice that you should generally use median not mean to eliminate outliers. Example: The following article  has 16 reviews at the moment: review = c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 3, 2, 1, 1) summary(review)  ## &quot;ordinary&quot; summary  Min. 1st Qu.  Median    Mean 3rd Qu.    Max.  1.000   3.750   5.000   4.062   5.000   5.000   Because they use Mean the article gets 4 stars but if they would use Median it would get 5 stars. Isn't the median a 'fairer' judge?  An experiment shows that median's error is always bigger than mean. Is median worse? library(foreach)  # the overall population of bookjudgments n &lt;- 5 p &lt;- 0.5 expected.value &lt;- n*p peoplesbelieve &lt;- rbinom(10^6,n, p)  # 16 ratings made for 100 books ratings &lt;- foreach(i=1:100, .combine=rbind) %do% sample(peoplesbelieve,16) stat    &lt;- foreach(i=1:100, .combine=rbind) %do% c(mean=mean(ratings[i,]),                     median=median(ratings[i,]))  # which mean square error is bigger? Mean's or Median's? meansqrterror.mean   &lt;- mean((stat[,&quot;mean&quot;]-expected.value)^2) meansqrterror.median &lt;- mean((stat[,&quot;median&quot;]-expected.value)^2)  res &lt;- paste(&quot;mean MSE&quot;,meansqrterror.mean) res &lt;- paste(res, &quot;| median MSE&quot;, meansqrterror.median) print(res)
7482
For a unimodal distribution that is moderately skewed, we have the following empirical relationship between the mean, median and mode: $$   \text{(Mean - Mode)}\sim  3\,\text{(Mean - Median)} $$ How was this relationship derived?   Did Karl Pearson plot thousands of these relationships before forming this conclusion, or is there a logical line of reasoning behind this relationship?
14197
I am performing hierarchical clustering on data I've gathered and processed from the reddit data dump on Google BigQuery.   My process is the following:   Get the latest 1000 posts in /r/politics Gather all the comments Process the data and compute an n x m data matrix (n:users/samples, m:posts/features) Calculate the distance matrix for hierarchical clustering Choose a linkage method and perform the hierarchical clustering Plot the data as a dendrogram   My question is, how do I determine what the best linkage method is? I'm currently using Ward but how do I know if I should be using single, complete, average, etc?  I'm very new to this stuff but I can't find a clear answer online as I'm not sure there is one. So what might be a good idea for my application? Note the data is relatively sparse in the sense that the n x m matrix has a lot of zeroes (most people don't comment on more than a few posts).
120683
From a conceptual and algorithmic standpoint, I understand how K-means works. However, from a mathematical standpoint, I don't understand why minimizing the WCSS (within-cluster sums of squares) will necessarily maximize the distance between clusters. In other words, can somebody show how this  is equal to maximizing the distance between clusters? It would be helpful to see a derivation that shows all of the steps or please point me to the appropriate reference(s).  Update I found this Witten and Tibshirani  but it isn't obvious how to get from equation 7 to equation 8.
97591
Popular topic models like LDA usually cluster words that tend to co-occur together into the same topic (cluster).   What is the main difference between such topic models, and other simple co-occurrence based clustering approaches like PMI ? (PMI stands for Pointwise Mutual Information, and it is used to identify the words that co-occur with a given word.)