pdmlabs.postprocessing.default#

Identity/passthrough post-processor (no-op transformation).

DefaultPostProcessor returns scores unchanged. Useful for: - Baseline comparisons (post-processing disabled) - Testing if post-processing helps or hurts performance - Experiments where thresholding happens elsewhere

Classes

DefaultPostProcessor(event_preferences)

No-op post-processor that returns scores unchanged.

class pdmlabs.postprocessing.default.DefaultPostProcessor(event_preferences: EventPreferences)#

Bases: PostProcessorInterface

No-op post-processor that returns scores unchanged.

This is an identity transformation: fit() does nothing, transform() and transform_one() return input scores as-is. Useful for experiments that compare post-processing vs. no post-processing.

Examples

>>> from pdmlabs.postprocessing.default import DefaultPostProcessor
>>> processor = DefaultPostProcessor(event_preferences={'failure': [], 'reset': []})
>>> scores = [0.1, 0.5, 0.9, 0.3]
>>> processor.fit([df_train], ['bearing_1'], events_df)
>>> transformed = processor.transform(scores, 'bearing_1', events_df)
>>> transformed == scores  # Always True
True
fit(historic_data: list[DataFrame], historic_sources: list[str], event_data: DataFrame, anomaly_ranges=None) None#

No-op fit (does nothing).

Parameters:
  • historic_data (list[pd.DataFrame]) – Ignored.

  • historic_sources (list[str]) – Ignored.

  • event_data (pd.DataFrame) – Ignored.

  • anomaly_ranges – Ignored.

get_params()#

Return empty parameter dict (no hyperparameters).

Returns:

Empty dict {}.

Return type:

dict

transform(scores: list[float], source: str, event_data: DataFrame) list[float]#

Return scores unchanged (identity transformation).

Parameters:
  • scores (list[float]) – Anomaly scores to process.

  • source (str) – Source identifier (ignored).

  • event_data (pd.DataFrame) – Event log (ignored).

Returns:

Same as input scores.

Return type:

list[float]

transform_one(score_point: float, source: str, is_event: bool) float#

Return single score unchanged.

Parameters:
  • score_point (float) – Single anomaly score.

  • source (str) – Source identifier (ignored).

  • is_event (bool) – Event flag (ignored).

Returns:

Same as input score.

Return type:

float