@@ -55,13 +55,13 @@ This model is closer to what we saw previously: it is a linear model trained on
55
55
a non-linear feature transformation. We will build, train and evaluate such a
56
56
model as part of this exercise. Thus, you need to:
57
57
58
- - create a new data matrix containing the cube of the speed, the speed, the
59
- speed multiplied by the sine of the angle of the slope, and the speed
60
- multiplied by the acceleration. To compute the angle of the slope, you need to
61
- take the arc tangent of the slope (` alpha = np.arctan(slope) ` ). In addition,
62
- we can limit ourself to positive acceleration only by clipping to 0 the
63
- negative acceleration values (they would correspond to some power created by
64
- the braking that we are not modeling here).
58
+ - create a new data matrix ` data_linear_model ` containing the cube of the speed,
59
+ the speed, the speed multiplied by the sine of the angle of the slope, and the
60
+ speed multiplied by the acceleration. To compute the angle of the slope, you
61
+ need to take the arc tangent of the slope (` alpha = np.arctan(slope) ` ). In
62
+ addition, we can limit ourself to positive acceleration only by clipping to 0
63
+ the negative acceleration values (they would correspond to some power created
64
+ by the braking that we are not modeling here).
65
65
- using the new data matrix, create a linear predictive model based on a
66
66
[ ` sklearn.preprocessing.StandardScaler ` ] ( https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html )
67
67
and a
@@ -298,7 +298,9 @@ _Select a single answer_
298
298
299
299
Now, we will go more into details by picking a single ride for the testing and
300
300
analyse the predictions of the models for this test ride. To do so, we can reuse
301
- the ` LeaveOneGroupOut ` cross-validation object in the following manner:
301
+ the ` LeaveOneGroupOut ` cross-validation object in the following manner, where
302
+ ` data_linear_model ` is the matrix defined in question 1 with the augmented data
303
+ features:
302
304
303
305
``` python
304
306
cv = LeaveOneGroupOut()
@@ -349,7 +351,7 @@ data_test_subset = data_test[time_slice]
349
351
target_test_subset = target_test[time_slice]
350
352
```
351
353
352
- It allows to select data from 5.00 pm until 5.05 pm. Used the previous fitted
354
+ It allows to select data from 5.00 pm until 5.05 pm. Use the previous fitted
353
355
models (linear and gradient-boosting regressor) to predict on this portion of
354
356
the test data. Draw on the same plot the true targets and the predictions of
355
357
each model.
0 commit comments