開始使用免費開始

將模型擬合到例行賽訓練資料

現在你已經定義了一個完整的球隊實力模型,可以把它擬合到籃球資料上了!由於你的模型現在有兩個輸入,你需要把輸入資料以清單的形式傳入。

本練習屬於課程

使用 Keras 的進階深度學習

檢視課程

練習說明

  • 分別將 games_season 中的 'team_1''team_2' 欄位指定給 input_1input_2
  • 使用 games_season'score_diff' 欄位作為目標。
  • 以 1 個 epoch、batch size 為 2048,並使用 10% 的驗證切分來訓練模型。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Get the team_1 column from the regular season data
input_1 = games_season[___]

# Get the team_2 column from the regular season data
input_2 = games_season[___]

# Fit the model to input 1 and 2, using score diff as a target
____(____,
          ____,
          epochs=____,
          batch_size=____,
          validation_split=____,
          verbose=True)
編輯並執行程式碼