@@ -180,9 +180,8 @@ In the previous cross-validation, we made the choice of using a `ShuffleSplit`
180180cross-validation strategy. It means that randomly selected samples were selected
181181as testing set ignoring any time dependency between the lines of the dataframe.
182182
183- We would like to have a cross-validation strategy that evaluates the capacity of
184- our model to predict on a completely new bike ride: the samples in the
185- validation set should only come from rides not present in the training set.
183+ We would like to have a cross-validation strategy that takes into account the
184+ groups defined by each individual date. Each group corresponds to a bike ride.
186185
187186``` {admonition} Question
188187How many bike rides are stored in the dataframe `data`? Do not hesitate to
@@ -204,14 +203,12 @@ Hint: You can access to the date and time of a `DatetimeIndex` using
204203
205204+++
206205
207- Instead of using the naive ` ShuffleSplit ` strategy, we will use a strategy that
208- takes into account the group defined by each individual date. It corresponds to
209- a bike ride. We would like to have a cross-validation strategy that evaluates
210- the capacity of our model to predict on a completely new bike ride: the samples
211- in the validation set should only come from rides not present in the training
212- set. Therefore, we can use a ` LeaveOneGroupOut ` strategy: at each iteration of
213- the cross-validation, we will keep a bike ride for the evaluation and use all
214- other bike rides to train our model.
206+ We would like to have a cross-validation strategy that evaluates the capacity of
207+ our model to predict on a completely new bike ride: the samples in the
208+ validation set should only come from rides not present in the training set.
209+ Therefore, we can use a ` LeaveOneGroupOut ` strategy: at each iteration of the
210+ cross-validation, we will keep a bike ride for the evaluation and use all other
211+ bike rides to train our model.
215212
216213Thus, you concretely need to:
217214
0 commit comments