Session Ready
Exercise

Accounting for non-stationarity

In this exercise, you will again visualize the variations in model scores, but now for data that changes its statistics over time.

An instance of the Linear regression model object is stored in model, a cross-validation object in cv, and the data in X and y.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Create an empty DataFrame to collect the results.
  • Iterate through multiple window sizes, each time creating a new TimeSeriesSplit object.
  • Calculate the cross-validated scores (using a custom scorer we defined for you, my_pearsonr) of the model on training data.