From 94e0c2e01e3bff7d08b485068314affac34f2096 Mon Sep 17 00:00:00 2001 From: Hanz Tantiangco <37241205+HanzTantiangco@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:43:03 +0100 Subject: [PATCH] fix: Scale the targets for test data I came across a problem where the model prediction is not being updated on the graph in the 'Check Out Your Predictions' section of the notebook because the test data was not scaled. See the following Udacity mentor's comments on the Knowledge platform for reference: https://knowledge.udacity.com/questions/510089 --- project-bikesharing/Predicting_bike_sharing_data.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project-bikesharing/Predicting_bike_sharing_data.ipynb b/project-bikesharing/Predicting_bike_sharing_data.ipynb index 3e46b94843..44e81f22fb 100755 --- a/project-bikesharing/Predicting_bike_sharing_data.ipynb +++ b/project-bikesharing/Predicting_bike_sharing_data.ipynb @@ -134,7 +134,8 @@ "for each in quant_features:\n", " mean, std = data[each].mean(), data[each].std()\n", " scaled_features[each] = [mean, std]\n", - " data.loc[:, each] = (data[each] - mean)/std" + " data.loc[:, each] = (data[each] - mean)/std\n" + " test_data.loc[:, each] = (test_data[each] - mean)/std" ] }, {