Arguments
- data_with_scores
A data frame containing an
anomaly_scorecolumn, typically the output ofscore_anomaly().- threshold
Numeric value between 0 and 1. Records with anomaly_score >= threshold are flagged as anomalous. If NULL (default), uses the contamination rate from the
score_anomaly()attributes.- contamination
Numeric value between 0 and 1. If
thresholdis NULL, this proportion of records with the highest scores will be flagged. Default is 0.05 (5
The input data frame with an additional is_anomaly logical column
indicating whether each record is flagged as anomalous.
Categorizes records as anomalous or normal based on their anomaly scores,
using either a fixed threshold or a contamination rate.
