1

Imagine I have a single cluster of points in a 2D map (not in a normal distribution), each point having (x,y) coordinates. Thus, no need to do data categorization.

enter image description here

What's the simplest technique to remove outliers from this 2D cluster?

I need to write out of the box a JavaScript function, since I couldn't find anything for JavaScript. Thus I want something simple to implement.

What did I imagine

I imagined to have 3 arrays: array of all $x$ coordinates, array of all $y$ coordinates and an array of the distances $d$ of each point to the center of the cluster, i.e., $d=\sqrt{(x-x_c)^2+(y-y_c)^2}$ where the center is $c=(c_x,c_y)$.

Then I would apply a simple 1D outlier algorithm to each of the 3 arrays and remove all the corresponding points if any respective coordinate (x, y, d) would be an outlier.

Is this reasonable?

1 Answers1

0

Considering I did not find anything ready to be used out of the box, I created myself a npm package named outliers2d.