note
moklevat
I was initially going to suggest [http://en.wikipedia.org/wiki/Principal_components_analysis|principal components analysis] as a solution, since the example decomposition you presented appears to be a clustering problem. I would then have pointed you to [cpan://PDL] and [cpan://PDL::PCA]. However, after reading some of the other comments my poor old neuron suspects that there is something more afoot that may invalidate PCA for the general case.
600418
600418