Session Ready
Exercise

Train XGBoost models

Every Machine Learning method could potentially overfit. You will see it on this example with XGBoost. Again, you are working with the Store Item Demand Forecasting Challenge. The train DataFrame is available in your workspace.

Firstly, let's train multiple XGBoost models with different sets of hyperparameters using XGBoost's learning API. The single hyperparameter you will change is:

  • max_depth - maximum depth of a tree. Increasing this value will make the model more complex and more likely to overfit.
Instructions 1/3
undefined XP
  • 1
    • Set the maximum depth to 2. Then hit Submit Answer button to train the first model.
    • 2
      • Now, set the maximum depth to 8. Then hit Submit Answer button to train the second model.
    • 3
      • Finally, set the maximum depth to 15. Then hit Submit Answer button to train the third model.