Classification Detector

Implementation of AD algorithms based on classification.

class ecgan.anomaly_detection.detector.classification_detector.ClassificationDetector(module, tracker)[source]

Bases: ecgan.anomaly_detection.detector.base_detector.AnomalyDetector, abc.ABC

Base class for anomaly detectors which directly classify data.

The anomalousness is asserted based on the classification score.

__init__(module, tracker)[source]
_get_data_to_save()[source]

Select data that shall be saved after anomaly detection.

Return type

Dict

load(saved_data)[source]

Load data from dict.

class ecgan.anomaly_detection.detector.classification_detector.ArgmaxClassifierDetector(module, tracker)[source]

Bases: ecgan.anomaly_detection.detector.classification_detector.ClassificationDetector

Detector which utilizes the maximum output of a classifier to predict labels.

__init__(module, tracker)[source]
_detect(data)[source]

Detect anomalies.

Parameters

data (Tensor) -- Tensor (usually of size [series, channel, data points]) of data which shall be classified.

Return type

Tensor

Returns

A Tensor with the corresponding labels.

static configure()[source]

Configure the default settings for an RNNClassifierDetector.

Return type

Dict