I am investigating anomalies as the mean value of a field over buckets. So far, the results seem to be correct. However, in the domain I am working with, if the number of documents in the buckets is lower than some threshold values, it is unlikely to be an anomaly or an anomaly that can be ignored.
Therefore, I would like to eliminate the buckets to be considered anomalies if the number of documents in the bucket is lower than some threshold. However, I also want them to be considered in the modeling process. As far as I can see, I can do that only if I use the count function in my detector.
To sum up, my question is: Is it possible to add a custom rule to ignore the anomalies if the number of documents for the bucket is lower than some threshold when I use a metric function in the detector?