If you are Python fan then head over to SciKit site where there is a ton of interesting machine learning stuff, including clustering techniques. As usual, Mathematica is more condensed and really fun to play with. Here is an example with two clusters

Clear[x1,x2,all,components,clustered, original];
original = Graphics[{Gray,Point@ Join[x1,x2]},ImageSize->300];
components = ClusteringComponents[all,2,1, Method->"KMeans"];
{c1,c2} = {Pick[all,components,1],Pick[all,components,2]};
clustered = Graphics[{Green,Point@c1,Orange,Point@c2},ImageSize->300];
Row[{original, clustered}]

Two Clusters

A great blog with plenty of machine learning is Anton’s Mathematica for predictions.