# Can k-means clustering get shells as clusters?

Imagine you have $k$ classes. Every class $i$ has points which are follow a probability distribution, such that their distance to 0 is $i$ in mean, but this distance follows a normal distribution. The direction is uniformly distributed. So all classes are in shells around the origin 0.

Can $k$-means get these shells when you choose the "right" distance metric? (Obviously it can't find it if you take the euclidean metric, but I wonder if there is any metric at all or if this problem is inherently unsolvable by $k$-means, even if you know the number of clusters $k$)

• I'm not sure if "shell" is the right word. Probably "spheres" is better? Google finds for both, "concentric spheres" and "concentric shells" images. – Martin Thoma Dec 2 '15 at 16:17
• It sounds like you'd do best explicitly calculating the magnitude of each vector and then clustering based on magnitude explicitly. – jamesmf Dec 2 '15 at 16:31
• @jamesmf If I know that my data looks like this, I cluster the integer distance to 0, of course. But that would be "cheating". You can always apply functions to make your data linearly separable. The question is how complicated the data has to get until the algorithm fails. For single layer neural neurons it was XOR, for example. Of course, you could say that the single layer neuron could classify XOR correct if you give it XOR as input, but that is not the point... – Martin Thoma Dec 2 '15 at 22:00
• I understand your point, I simply meant that choosing an arbitrary distance metric for kmeans was not meaningfully different than explicitly calculating magnitude and using "traditional" distance metrics. – jamesmf Dec 2 '15 at 22:46
• @jamesmf Ah, ok, now I get what you mean. Yes, you're right. I didn't think of that before. However, I'm still happy I've asked the question here, because I could learn something by the answer :-) – Martin Thoma Dec 2 '15 at 22:59