1. 学习
  2. /
  3. 课程
  4. /
  5. Winning a Kaggle Competition in Python

Connected

练习

Overall validation score

Now it's time to get the actual model performance using cross-validation! How does our store item demand prediction model perform?

Your task is to take the Mean Squared Error (MSE) for each fold separately, and then combine these results into a single number.

For simplicity, you're given get_fold_mse() function that for each cross-validation split fits a Random Forest model and returns a list of MSE scores by fold. get_fold_mse() accepts two arguments: train and TimeSeriesSplit object.

说明 1 / 共 3 个

undefined XP
    1
    2
    3
  • Create time 3-fold cross-validation.
  • Print the numpy mean of MSE scores by folds.