How do you cope with not being able to imagine more than 3 dimensions?
I can't wrap my head around what happens in K-means algorithm when there are 4 or more variables.
How did you simplify or explain it to someone?
Explaining a K-means algorithm is like explaining colors.
You might be able to "visualize" some 4-dimensional objects by imagining a bunch of 3-dimensional cross-sections placed one after another in sequence. The idea is much like trying to get a sense for the geometry of a 3-dimensional object by considering 2-dimensional snapshots taken at various depths.
If your object/space is infinite, this may be quite tricky. If it's continuous rather than discrete, you may still be able to make this work well by interpolating appropriately between consecutive cross-sections.
I guess you could also extend this to 5 or 6 dimensions by considering 2- or 3-dimensional arrays of cross-sections, instead of just a straight line of them. You could then extend even further to, e.g., 7 dimensions by considering a 1-dimensional array whose elements are 3-dimensional arrays of 3-dimensional cross-sections. This obviously gets difficult pretty quickly, though.
If imagining a bunch of 3-dimensional cross-sections is still too yucky for your liking, you might instead "visualize" a 4-dimensional object by imagining a 2-dimensional array whose elements are 2-dimensional cross sections. Moving left/right or up/down in the array corresponds to traveling along the two unseen dimensions. This way, your visualization can occur entirely within two dimensions.
This all seems to make sense in my head, anyway. I don't know whether it'll actually prove helpful.
it's not hard to imagine 4 dimensions.
just have a long row of cubes where the cube count "d" represents the value of the 4th dimension. Now pick your 4th dimension value and look at that cube only.
Don't try to visualize any dimension, just become comfortable with the difference between 2D and 3D. There is an entire axis independent of the rest, otherwise structurally similar. For any higher dimension, repeat again.