訓練並評估模型
你已經定義了一個新模型,現在把它訓練在例行賽的籃球資料上。
接著,使用你在上一個練習中訓練好的 model(該模型已在例行賽資料上訓練),在錦標賽比賽的資料(games_tourney)上評估其表現。
本練習屬於課程
使用 Keras 的進階深度學習
練習說明
- 將模型訓練在
games_season資料集上,使用 'team1'、'team2' 和 'home' 三個欄位作為輸入,並以 'score_diff' 欄位作為目標。 - 設定訓練參數為 1 個 epoch、10% 驗證分割,batch size 為 2048。
- 在
games_tourney上評估模型,並使用相同的輸入與輸出設定。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Fit the model to the games_season dataset
____([____, ____, ____],
____,
epochs=____,
verbose=____,
validation_split=____,
batch_size=____)
# Evaluate the model on the games_tourney dataset
print(____.____(____, ____, verbose=False))