完美模型
在這個練習中,你將重建一個完美模型的 lift 曲線。為此,你需要先建立「完美預測」。
請回想,plot_lift_curve 方法在 predictions 參數中需要兩個值:第一個對應目標為 0,第二個對應目標為 1。
本練習屬於課程
Python 預測分析入門
練習說明
- 建立一個包含完美預測的清單。
- 目標的真實值在
targets_test。使用這組完美預測繪製 lift 曲線。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Generate perfect predictions
perfect_predictions = [(1-target , ____) for target in targets_test["target"]]
# Plot the lift curve
skplt.metrics.____(targets_test, ____)
plt.show()