Anomaly Detection - Negative Score Values?

I’m playing around with the anomaly detection learning block, and I’m curious what the “anomaly score” refers to. The couple of times I’ve worked with anomaly detection, this is usually a distance measurement from the sample’s features to the center of the training set cluster.

In testing, I get negative values for the anomaly score. What does this mean? If it’s a distance measurement, do I just need to take the absolute value and compare it to the threshold (e.g. default of 0.3)? Or is it some other kind of measurement where -0.3 is really below the threshold of 0.3?

I checked the docs, and I didn’t see any reference to this. Perhaps I missed something, though.

@ShawnHymel. I to get negative values as well from the Anomaly results. Didn’t think anything of it until you mentioned it.

@electronictechgreg @ShawnHymel This is correct, so what we do here is:

  1. Create X number of clusters and group all the data. For each of these clusters we store the center and the size of the cluster.
  2. During classification we calculate the closest cluster for a new data point, and show the distance from the edge of the cluster. If it’s within a cluster you thus get a value below 0.

Hope this helps!

1 Like

My IMU is giving me negative data. So this would explain the negative results based off of the classification method?

No, it’s distance to the cluster, it has nothing to do with the raw IMU data.

Oh okay. Thank you for the clarification.