Multivariate drift detection

Monitoring Machine Learning in Python

Hakim Elakhrass

CEO and co-founder

What is multivariate drift detection?

  • First step of root cause analysis
  • The result is a single number for all features
  • Detects subtle data changes

The image shows the monitoring workflow and where the multivariate drift detection is placed there.

Monitoring Machine Learning in Python

How it works?

  1. Compressing the data using PCA algorithm
  2. Decompressing the data to initial shape using inverse PCA algorithm
  3. Measure the reconstruction error, which increase indicates the data drift

The image shows how the multivariate drift detection works.

Monitoring Machine Learning in Python

Code implementation

# Initialize multivariate drift detection calculator
mv_calc = nannyml.DataReconstructionDriftCalculator(
    column_names=features_column_names,
    timestamp_column_name='timestamp',
    chunk_period='m'
    )
# Fit and calculate the results
mv_calc.fit(reference)
mv_results = mv_calc.calculate(analysis)
Monitoring Machine Learning in Python

Plotting the results

mv_figure = mv_results.filter(period='analysis').plot()
mv_figure.show()

The image shows the reconstruction error graph over time.

Monitoring Machine Learning in Python

Multivariate drift vs. realized performance

figure = mv_results.filter(period='analysis').compare(perf_results).plot()
figure.show()

The image shows the comparison graph with realized performance and reconstruction error.

Monitoring Machine Learning in Python

Let's practice!

Monitoring Machine Learning in Python

Preparing Video For Download...