energy_fault_detector.quick_fault_detection.configuration

select_config(train_data, normal_index, status_label_confidence_percentage, features_to_exclude, angles, automatic_optimization)

Selects a suitable config for the given data. The config is determined based on the data dimension and a PCA. If automatic optimization is True an optuna hyperparameter optimization is done for the autoencoder.

Parameters:
  • train_data (pd.DataFrame) – Dataframe containing numerical values

  • normal_index (Union[pd.Series, None]) – Contains boolean information about which rows of train_data are normal and which contain anomalous behavior.

  • status_label_confidence_percentage (Optional float) – Determines the quantile for quantile threshold method.

  • features_to_exclude (Union[List[str], None]) – List of column names of train_data which should be ignored.

  • angles (Union[List[str], None]) – List of column names of angle features in train_data which need specialized preprocessing.

  • automatic_optimization (bool) – If True an optuna hyperparameter optimization is done for the autoencoder.

Returns:

(optimized) config object for the AnomalyDetector.

Return type:

Config

update_autoencoder_config(config, autoencoder_params)

Updates autoencoder parameters in the config with the new (optimized) parameters.

Parameters:
  • config (Config) – Config object for an AnomalyDetector.

  • autoencoder_params (dict) – Dictionary defining new parameter values for the autoencoder

Returns:

Updated config object.

Return type:

Config

update_preprocessor_config(config, features_to_exclude, angles)

Updates data preprocessor parameters in the config with user given metadata for features.

Parameters:
  • config (Config) – Config object for an AnomalyDetector.

  • features_to_exclude (Union[List[str], None]) – List of column names which should be ignored.

  • angles (Union[List[str], None]) – List of column names of angle features which need specialized preprocessing.

Returns:

Updated config object.

Return type:

Config

update_threshold_config(config, quantile)

Updates threshold parameters in the config.

Parameters:
  • config (Config) – Config object for an AnomalyDetector.

  • quantile (float) – Quantile for the quantile threshold method (must be a float between 0 and 1)

Returns:

Updated config object.

Return type:

Config