# Best clustering technique for outlier detection?

I have around 15-20 points every second, and I would like to detect outliers based on

-their density along x-axis , that means if I am using k-mean clustering then I specify that in x-direction max of a variance is tolerated and in y max of b is tolerated. and a << b for this case.

Hence I get elliptical clusters.

Moreover, I think that clustering algorithms based on density clustering will suit my problem or if you recommend any other please suggest.

In the following figure, the most I am interested in the points which are near to -10 at x-axis and I would like to retain them rest the ones >-12. I want to discard them, but I would need a general clustering method to do it for all the data, as the point (-10) in this specific case, changes from season to season.

Thank you for your time, and please let me know if any further info is required or you have any tips . It would be most welcome

• Why not use an outlier detection algorithm? Clustering is not a good tools to detect outliers unless you are willing to put very stringent models on what the outliers can look like – user603 Oct 9 '14 at 12:55
• Indeeed thats a nice idea, I didnt thought about that, would you recommend any specific outlier detection algorithm? – Omer Oct 9 '14 at 13:20
• Sure, as long as you have two variables (X,Y), I would have a look at the OGK. It's computationally very light and easy to grasp (the link points to an R implementation with references therein). – user603 Oct 9 '14 at 13:28
• k-means doesn't use thresholds a,b - so you are talking about some other algorithm, but not k-means. – Has QUIT--Anony-Mousse Oct 9 '14 at 19:04
• Yes, you are right! Because k means gives both x and y dimension the same weightage, In my case, I would like to give my x-axis more weightage and y axis come. I cannot completely ignore one axis and when I give both of the axis same weight, during the transition, when the data is not concentrated in either of them, it gives poor results. – Omer Oct 10 '14 at 10:02

Note that it is trivial to add weights $\Omega=\{\omega_1,\ldots,\omega_d\}$ into Euclidean distance:
$$\text{Euclidean}_\Omega(x,y) := \sqrt{\sum_{i=1}^{d} \omega_i(x_i-y_i)^2}$$