小費預測的效能估計
在前面的練習中,你已經為 NYC Green Taxi 資料集準備了參考集與分析集。這一題中,你會使用這些資料來估計模型在正式環境中的效能。
首先,請用提供的參數初始化 DLE 演算法,然後繪製結果。
參考集與分析集已載入並分別存於變數 reference 與 analysis。
此外,nannyml 也已經匯入。
本練習屬於課程
在 Python 中監控 Machine Learning
練習說明
- 以每日為切分期間(daily chunk period)初始化 DLE,將
tip_amount指定為y_true,並使用 MSE 指標。 - 將
reference套用到 DLE 估計器進行擬合,對分析集進行效能估計,並將輸出存為變數results。 - 使用
plot()與show()方法將結果視覺化。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
estimator = nannyml.DLE(y_pred='y_pred',
timestamp_column_name='lpep_pickup_datetime',
feature_column_names=features,
chunk_period='d',
y_true='tip_amount',
metrics=['mse'])
# Fit the reference data to the DLE algorithm
estimator.____(____)
# Estimate the performance on the analysis data
results = estimator.____(____)
# Plot and show the results
____.____().____()