anomaly_thresh function

Apply threshold to anomaly score