Adding plausibility checks to `flagUniLOF`
flagUniLOF
suffers from overflagging, when the data has steep partitions of increase or decrease (in the context of the datas average behavior).
The MR adds some (fairly simple) plausibility checks to mitigate this overflagging effect:
- If an outlier cluster is closely preceeded by a value lower than all values of the cluster, and closely succeeded by a value higher than all the the values in the cluster, it cant be an outlier cluster, since it is an upwards slope than
- the other way around for downwards slopes
- if an outlier cluster is succeeded or preceeded by a value lying within the outlier clusters value range, its not an outlier cluster.