energy_fault_detector.threshold_selectors.fdr_threshold

class FDRSelector(target_false_discovery_rate=0.2)

Bases: ThresholdSelector

Find a threshold given a target false discovery rate (FDR).

Parameters:

target_false_discovery_rate (float) – The target FDR to fit the threshold to. Defaults to 0.2.

threshold

Scores above the threshold are classified as anomalies, while scores below are classified as normal.

Type:

float

actual_false_discovery_rate_

The actual FDR (the nearest threshold to the target) after fitting.

Type:

float

Example Configuration:

train:
  threshold_selector:
    name: FDRSelector
    params:
      target_false_discovery_rate: 0.2
fit(x, y=None)

Finds a threshold given the specified false discovery rate.

Parameters:
  • x (Array1D) – Array with calculated anomaly scores.

  • y (pd.Series, optional) – Labels indicating whether each sample is normal (True) or anomalous (False). Required for FDR threshold calculation.

Returns:

The instance of this class after fitting the threshold.

Return type:

FDRSelector