# Threshold for kmeans anomaly detection

I'm learning the kmeans to find out anomaly from the dataset. but I don't know how to set threshold. I tried by the putting mean of the centroid to point distance but it's not working, half my record is shown as an anomaly. I know setting threshold depends on what data you have but I want to know , is there any thing from that I find out the threshold or set any value which affects less on my data.

• K-means is sensitive to outliers. I don't think it can be used for anomaly detection. Aug 11 '17 at 6:19
• @Anony-Mousse can you suggest me another algorithm for anomaly detection Aug 11 '17 at 6:37
• Google for outlier detection algorithms. There are plenty: kNN, LOF, Loop,... Aug 11 '17 at 6:55
• @Anony-Mousse thnk you i will try Aug 11 '17 at 6:58
• @Anony-Mousse i want to ask you one thing I'm calculating distance between centroid and point using sqdist is it correct I'm new so in this Aug 11 '17 at 8:59

 1. Determine the  cluster label your dataset closest to. If you have just