性能估计

Python 中的机器学习监控

Hakim Elakhrass

Co-founder and CEO of NannyML

算法概览

  • CBPE - 置信度驱动的性能估计
  • DLE - 直接损失估计
Python 中的机器学习监控

直接损失估计

  • 用于回归任务
  • 估计被监控模型的损失函数
  • 使用 LGBM 作为"额外"模型
  • NannyML 支持 MAE、MSE、RMSE 等回归指标

 

该图展示 DLE 的工作原理:首先接收生产数据,基于预测和生产数据创建分析集;将分析集传入额外模型以预测性能。

Python 中的机器学习监控

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 中的机器学习监控

基于置信度的性能估计

  • 用于二分类与多分类问题

  • 利用置信度分数估计混淆矩阵

  • 可估计任意分类性能指标

 

该图展示 CBPE 的工作原理:将分析集传入 CBPE 以预测混淆矩阵,并据此计算其他分类指标。

Python 中的机器学习监控

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 中的机器学习监控

结果

results.plot().show()

结果图显示随时间变化的 RMSE 估计值。

Python 中的机器学习监控

让我们来练习!

Python 中的机器学习监控

Preparing Video For Download...