商業價值計算與估計

在 Python 中監控 Machine Learning

Maciej Balawejder

Data Scientist

模型的商業價值

  • 機器學習模型的目標是為業務帶來價值。
  • 模型的商業價值可能因以下原因下降:
    • 客戶習慣改變
    • 模型可能不再有用
在 Python 中監控 Machine Learning

混淆矩陣

此圖顯示含 TP、FN、FP、TN 的混淆矩陣。

  • True positive(TP)-模型正確預測訂房不會被取消
  • False positive(FP)-模型錯誤預測訂房不會被取消
  • False negative(FN)-模型錯誤預測訂房會被取消
  • True negative(TN)-模型正確預測訂房會被取消
在 Python 中監控 Machine Learning

商業價值公式

此圖顯示混淆矩陣與商業價值矩陣的相乘與加總。

  • True positive(TP)-不增加也不減少價值。
  • False positive(FP)-導致調房與折扣,飯店成本 $200。
  • False negative(FN)-成本 $100,需留一晚直到找到替補。
  • True negative(TN)-價值 $1000,因飯店可把房間租給他人。
在 Python 中監控 Machine Learning

當標籤可用時

此圖顯示在標籤可用時計算模型商業價值的流程。

# Initialize the calculator
calculator = nannyml.PerformanceCalculator(...
    problem_type='classification_binary',
    metrics=['business_value'],
    # [value_of_TN, value_of_FP], [value_of_FN, value_of_TP]]
    business_value_matrix = [[0, -200],[-100, 1000]],
    normalize_business_value='None')
在 Python 中監控 Machine Learning

當標籤不可用時

此圖顯示在標籤不可用時估計模型商業價值的流程。

# Initialize the estimator
estimator = nannyml.CBPE(...
    problem_type='classification_binary',
    metrics=['business_value'],
    # [value_of_TN, value_of_FP], [value_of_FN, value_of_TP]]
    business_value_matrix = [[0, -200],[-100, 1000]],
    normalize_business_value='per_prediction')
在 Python 中監控 Machine Learning

一起來練習吧!

在 Python 中監控 Machine Learning

Preparing Video For Download...