orion.detect_anomalies

orion.detect_anomalies(data=None, pipeline=None, hyperparameters=None, train_data=None)[source]

Detect anomalies on timeseries data.

The anomalies are detected using an Orion pipeline which can be passed as:

  • An Orion instance.

  • An str with the path to an Orion pickle file.

  • An str with a path to a JSON file.

  • An str with the name of a registered Orion pipeline.

  • An MLPipeline instance.

  • A dict with an MLPipeline specification.

If no pipeline is passed, the default Orion pipeline is used.

Optionally, separated learning data can be passed to fit the pipeline to it before using it to detect anomalies.

Parameters
  • data (str or DataFrame) – Data to analyze searching for anomalies. It can be passed as a path to a CSV file or as a DataFrame.

  • pipeline (str or Pipeline or dict) –

    Pipeline to use. It can be passed as:
    • An Orion instance.

    • An str with the path to an Orion pickle file.

    • An str with a path to a JSON file.

    • An str with the name of a registered pipeline.

    • An MLPipeline instance.

    • A dict with an MLPipeline specification.

  • hyperparameters (str or dict) – Hyperparameters to set to the pipeline. It can be passed as a hyperparameters dict in the mlblocks format or as a path to the corresponding JSON file. Ignored if being passed a previously serialized Orion instance. Defaults to None.

  • train_data (str or DataFrame) – Data to which the pipeline should be fitted. It can be passed as a path to a CSV file or as a DataFrame. If not given, the pipeline is used without fitting it first.

Returns

pandas.DataFrame containing the detected anomalies.

Return type

DataFrame