多變量飄移偵測

在 Python 中監控 Machine Learning

Hakim Elakhrass

CEO and co-founder

什麼是多變量飄移偵測?

  • 根因分析的第一步
  • 針對所有特徵輸出單一數值
  • 偵測細微的資料變化

此圖示出監控流程,以及多變量飄移偵測在其中的位置。

在 Python 中監控 Machine Learning

如何運作?

  1. 使用 PCA 演算法壓縮資料
  2. 用逆向 PCA 還原為原始形狀
  3. 衡量重建誤差;誤差上升表示資料飄移

此圖說明多變量飄移偵測的運作方式。

在 Python 中監控 Machine Learning

程式碼實作

# 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)
在 Python 中監控 Machine Learning

繪製結果

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

此圖顯示隨時間變化的重建誤差。

在 Python 中監控 Machine Learning

多變量飄移 vs. 實際效能

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

此圖比較實際效能與重建誤差。

在 Python 中監控 Machine Learning

一起來練習吧!

在 Python 中監控 Machine Learning

Preparing Video For Download...