Looking for spatial clusters and anomalies. Is DBSCAN the right tool?
Clustering in X,Y,Value
Clustering in 3d is great. But be careful with feature scaling in this case. Presumably X, Y have the same scales - so unless you want to treat the different directions differently, make sure not not apply any normalization. As that would distort the grid.
Your Value column on the order hand, might be on a very different scale from the X,Y values. If not corrected for this creates an implicit and usually quite arbitrary feature weighting, which is rarely desirable.
If you want to weight the Value column equally to X and Y, then scale the Values by the either mean,std or max,min of the X/Y columns.
If you do want to weight the individual attributes differently, then you can introduce additionally some weighting factors that scales them.
PS: remember that DBscan hyperparamters, such as epsilon is also given in the same unit as your feature space.
Anomalies in Value given X,Y location
Often an interesting question is &quot;is this value anomalous compared to the normal for this location?&quot;. This can be done on X and Y axis individually, but often there are interactions between X,Y and one should consider the two dimensions together. Here are some approaches for that:
Binning the 2D (X,Y) space
Divide the X and Y axis into a grid. Typically with uniformly sized cells. Assign each grid cell an location identifier. Then use this identifier as a feature.
This approach is simple and with a lot of dense data it usually works pretty OK. But the grid can fit the data pretty poorly, datapoints very close to eachother end up in different cells, and then quite distant in feature space.
Clustering in the 2D (X,Y) space
An alternative location scheme is to use clustering. Cluster the values just based on X,Y - and then use the cluster number as the location identifier. You may also want to include distance from the cluster center as a feature - since some values might fall pretty far from a cluster.
Angle from the cluster can in some cases also be informative.
This has a much better shot at creating good location features for the data. But is more complex. One also should consider when one wants to re-cluster.
Aside
Make sure to plot your data and look at it! For example use a 2d-plot with X,Y as coordinates, and the values using color. You may also want to do the same kind of plot, but then to use Anomaly Score as the color. If you upload a plot here, it will also be much easier to give good advice.