Auto-adaptive thresholds for anomaly detection