当标签可用时

Python 中的机器学习监控

Maciej Balawejder

Data Scientist

估计 vs 实际性能

估计性能:

  • 衡量模型在 {{1}} 的预期表现

  • 由 CBPE、DLE 等估计器确定

  • 在无真实标签时进行估计

实际性能:

  • 表示已被测量的表现
  • 由性能计算器确定
  • 在有真实标签时计算
Python 中的机器学习监控

真实标签延迟

图示为时间轴:每周三个时间点。每周一评估模型的实际性能,周一之间用 CBPE 估计性能。

Python 中的机器学习监控

性能计算器

# 初始化计算器
calc = nannyml.PerformanceCalculator(
    y_pred_proba='y_pred_proba',
    y_pred='y_pred',
    y_true='arrived',
    timestamp_column_name='timestamp',
    problem_type='classification_binary',
    chunk_period='d',
    metrics=['roc_auc', 'accuracy'],
    )
# 拟合计算器
calc.fit(reference)
realized_results = calc.calculate(analysis)
Python 中的机器学习监控

绘制结果

# 显示实际性能图
results.plot().show()

该图展示了实际的 ROC AUC 曲线,显示 2019 年 4 月至 2019 年 8 月的性能下降。

Python 中的机器学习监控

实际与估计性能

# 估计并计算结果
estimated_results = estimator.estimate(analysis)
realized_results = calculator.calculate(analysis)


# 显示对比图 realized_results.compare(estimated_results).plot().show()
Python 中的机器学习监控

实际与估计性能

该图比较了 ROC AUC 指标的实际与估计性能。

Python 中的机器学习监控

Vamos praticar!

Python 中的机器学习监控

Preparing Video For Download...