比較估計與實際的效能
既然你已經看過效能計算如何運作,現在請你為 NYC 綠色計程車資料集的小費預測模型計算實際效能。
參考集與分析集已載入並分別存在變數 reference 與 analysis 中。
另外,DLE 演算法針對小費預測的結果已存於變數 estimated_results。
本練習屬於課程
在 Python 中監控 Machine Learning
練習說明
- 在計算器初始化時,將問題型別指定為
regression。 - 使用參考資料進行擬合,並為分析集計算效能。
- 使用
compare()方法顯示realized_results與estimated_results的比較圖。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Intialize the calculator
calculator = nannyml.PerformanceCalculator(
y_true='tip_amount',
y_pred='y_pred',
chunk_period='d',
metrics=['mae'],
timestamp_column_name='lpep_pickup_datetime',
problem_type=____)
# Fit the calculator
calculator.fit(____)
realized_results = calculator.____(____)
# Show comparison plot for realized and estimated performance
____.____(____).plot().show()