效能估計

在 Python 中監控 Machine Learning

Hakim Elakhrass

Co-founder and CEO of NannyML

演算法

  • CBPE-信心為基礎的效能估計
  • DLE-直接損失估計
在 Python 中監控 Machine Learning

直接損失估計(DLE)

  • 用於迴歸任務
  • 估計受監控模型的損失函式
  • 使用 LGBM 作為「額外」模型
  • NannyML 支援多種迴歸指標,如 MAE、MSE、RMSE

 

此圖示說明 DLE 的運作流程:先將生產資料送入演算法,根據預測與生產資料建立分析集;分析集再傳給額外模型以預測效能。

在 Python 中監控 Machine Learning

DLE-程式碼實作

# Initialize the DLE algorithm
estimator = nannyml.DLE(
    y_true='target',
    y_pred='y_pred',
    metrics=['rmse'],
    timestamp_column_name='timestamp',
    chunk_period='d'
    feature_column_names=features,
    tune_hyperparameters=False
)
# Fit the algorithm
estimator.fit(reference)
results = estimator.estimate(analysis)
在 Python 中監控 Machine Learning

信心為基礎的效能估計(CBPE)

  • 用於二元與多類別分類問題

  • 利用信心分數估計混淆矩陣

  • 可估計任一分類效能指標

 

此圖示說明 CBPE 的運作流程:先將分析集傳入 CBPE 以預測混淆矩陣,再據此計算其他分類指標。

在 Python 中監控 Machine Learning

CBPE-程式碼實作

# Initialize the CBPE algorithm
estimator = nannyml.CBPE(
    y_pred_proba='y_pred_proba',
    y_pred='y_pred',
    y_true='targets',
    timestamp_column_name='timestamp',
    metrics=['roc_auc'],
    chunk_period='d',
    problem_type='classification_binary',
)
# Fit the algorithm
estimator.fit(reference)
results = estimator.estimate(analysis)
在 Python 中監控 Machine Learning

結果

results.plot().show()

結果圖顯示一段時間內的預估 RMSE 指標。

在 Python 中監控 Machine Learning

一起來練習吧!

在 Python 中監控 Machine Learning

Preparing Video For Download...