準備一個提交檔
你已經用 Kaggle 的 Store Item Demand Forecasting Challenge 訓練資料建立了模型。現在要在測試資料上產生預測,並依指定格式建立可送出的 CSV 檔。
你的目標是讀取測試資料、進行預測,並將結果存成與「sample_submission.csv」相同格式的檔案。你在上一個練習建立的 rf 物件已可在你的工作空間中使用。
注意:從現在起到本課程結束,pandas 函式庫都會自動幫你匯入,並可用 pd 存取。
本練習屬於課程
用 Python 拿下 Kaggle 競賽
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Read test and sample submission data
test = ____.____(____)
sample_submission = ____.____(____)
# Show the head() of the sample_submission
print(____.____)