I am trying to separate data into two groups using clustering (k-means) as you can see in the picture attached. My algorithm work perfectly on some data (see pic1),the problem is that it does not work in some regions for other data (see pic2), do you have any suggestions on how I can better filter the upper points ? Do you think a regression on the lower points would solve the problem ? If yes how can I do it only for these lower points and not all the data ?
Thank you in advance :)