Analyser

Analyses data collected by the Monitor using a customized Predictor for Concept Drift detection. Fast classifiers from Scikit-Multiflow or Facebook Prophet are great projects for that.

Analyser Predictor

class driftage.analyser.predictor.AnalyserPredictor(connection: driftage.db.connection.Connection)

Predictor base class for Concept Drift detection.

Parameters

connection (Connection) – Knowledge Based connection

async fit()

Load new model or get old data for model retrain. If you set None to retrain_period, than you can ignore this function on inheritance.

abstract async predict(X: driftage.analyser.predictor.PredictionData) → bool

Receives PredictionData and predicts if new data is a Concept Drift of not.

Parameters

X (PredictionData) – Data to be predicted as Concept Drift

Raises

NotImplementedError – Needs to be implemented when overridden

Returns

Prediction for whether PredictionData is a drift or not

Return type

bool

retrain_period() → Optional[int]

Retrain time period (in seconds). This property defines how long AnalyserPredictor will wait until next fit call. Retrain is optional and if it returns as None, fit method is never called on.

Returns

Time to wait for retrain in seconds or None if no retrain

Return type

Optional[int]

class driftage.analyser.predictor.PredictionData(data: dict, timestamp: datetime.datetime, identifier: str)

Dataclass to store data to predict.

Parameters
  • data (dict) – Data that comes from the Monitor.

  • created_at (datetime) – Datetime object of when the message was created.

  • identifier (str) – Data identifier that comes from the Monitor or any identifier you want.

data: dict = None
identifier: str = None
timestamp: datetime = None