#604·pyod

Inconsistent Anomaly Scores for Single Data Points vs. Batch in COPOD

Author: patselleCreated Aug 7, 2024Updated Sep 18, 2026

Hello,

I have observed an inconsistency in the anomaly scores produced by the COPOD algorithm when evaluating single data points versus a batch of identical data points. After fitting the model, the scores for a single data point differ from the scores when the same data point is part of a larger batch. Problem Description

When using the decision_function method, the anomaly score for an individual data point is not consistent with the score obtained when the same data point is included in a batch. This discrepancy seems to arise from how the algorithm combines training and test data for score calculation. Questions

  1. Intended Use: Is COPOD designed to handle individual data point evaluations consistently after fitting, or is it primarily intended for batch evaluations?
  2. Implementation Details: Are there recommended practices or modifications to ensure consistent anomaly scores regardless of the batch size?
  3. Suggested Fix: Would it be advisable to adjust the decision_function to avoid combining training and test data?

Your guidance on how to address this issue would be greatly appreciated.

Thank you!