Exercise

Time-based cross-validation

Finally, let's visualize the behavior of the time series cross-validation iterator in scikit-learn. Use this object to iterate through your data one last time, visualizing the training data used to fit the model on each iteration.

An instance of the Linear regression model object is available in your workpsace. Also, the arrays X and y (training data) are available too.

Instructions

100 XP
  • Import TimeSeriesSplit from sklearn.model_selection.
  • Instantiate a time series cross-validation iterator with 10 splits.
  • Iterate through CV splits. On each iteration, visualize the values of the input data that would be used to train the model for that iteration.