How to identify data after they have been through a whitening transformation and K-means clustering, python
Question: I am performing a K-means clustering in Python following this:
<http://glowingpython.blogspot.no/2012/04/k-means-clustering-with-scipy.html>
tutorial. I have my data, which are length, breadth and height - which I am
whitening using:

    
    
    from scipy.cluster.vq import whiten
    data = whiten(data)
    

After whitening I am doing the k-means clustering, following the tutorial. My
question is: how do I identify the data after I have whitened it? Both when it
comes to the plot, and when doing further analysis on the data. I want a way
of identifying which data comes in which cluster.


Answer: Do the whitening transform _manually_. It's really easy, if you **look at the
source code of`vq.whiten`**! No black magic involved, only linear algebra.

Then it's easy to store the _linear transformation_ \- and it's _reverse_ (a
multiplication, OMG!). Then you can map back the means to the original data.
If you didn't reduce dimensionality afterwards, it is fairly accurate.

Alternatively, just _recompute the means in the original data space_. This is
probably more accurate, but can be much more expensive if you have a lot of
data points.

