energy_fault_detector.core.fault_detection_result
- class FaultDetectionResult(predicted_anomalies, reconstruction, recon_error, anomaly_score, bias_data=None, arcana_losses=None, tracked_bias=None)
Bases:
objectClass to encapsulate results from the fault detection process.
- anomaly_score: Series
Series with predicted anomaly scores.
- arcana_losses: DataFrame | None = None
DataFrame containing recorded values for all losses in ARCANA. None if ARCANA was not run. Empty if losses were not tracked.
- bias_data: DataFrame | None = None
DataFrame with ARCANA results (ARCANA bias). None if ARCANA was not run.
- criticality(normal_idx=None, init_criticality=0, max_criticality=1000)
Criticality based on the predicted anomalies.
- Parameters:
normal_idx (pd.Series, optional) – A pandas Series with boolean values indicating normal operation, indexed by timestamp. Ignored if None.
init_criticality (int, optional) – The initial criticality value. Defaults to 0.
max_criticality (int, optional) – The maximum criticality value. Defaults to 1000.
- Return type:
Series
- classmethod load(directory, **kwargs)
Loads the results from CSV files in the specified directory.
- Parameters:
directory (str | Path) – The directory where the CSV files are stored.
kwargs – other keywords args for pd.read_csv (e.g., sep=’,’)
- Returns:
The loaded result object.
- Return type:
- predicted_anomalies: Series
Series with a predicted anomalies (bool).
- recon_error: DataFrame
DataFrame with reconstruction errors.
- reconstruction: DataFrame
DataFrame with reconstruction of the input data.
- save(directory, **kwargs)
Saves the results to CSV files in the specified directory.