A statistical anomaly detector that uses modified Z-Scores which are robust to preexisting outliers in the training set. The modified Z-Score uses the median and median absolute deviation (MAD) unlike the mean and standard deviation of a standard Z-Score - which are more sensitive to outliers. Anomalies are flagged if their final weighted Z-Score exceeds a user-defined threshold.
Note: An alpha value of 1 means the estimator only considers the maximum absolute Z-Score, whereas a setting of 0 indicates that only the average Z-Score factors into the final score.
Data Type Compatibility: Continuous
|1||threshold||3.5||float||The minimum Z-Score to be flagged as an anomaly.|
|2||alpha||0.5||float||The weight of the maximum per-sample Z-Score in the overall anomaly score.|
use Rubix\ML\AnomalyDetectors\RobustZScore; $estimator = new RobustZScore(3.0, 0.3);
Return the median of each feature column in the training set:
public medians() : float|null
Return the median absolute deviation (MAD) of each feature column in the training set:
public mads() : float|null
- B. Iglewicz et al. (1993). How to Detect and Handle Outliers.