Skip to content

Commit 94e0c2e

Browse files
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
1 parent 704a3e5 commit 94e0c2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

project-bikesharing/Predicting_bike_sharing_data.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@
134134
"for each in quant_features:\n",
135135
" mean, std = data[each].mean(), data[each].std()\n",
136136
" scaled_features[each] = [mean, std]\n",
137-
" data.loc[:, each] = (data[each] - mean)/std"
137+
" data.loc[:, each] = (data[each] - mean)/std\n"
138+
" test_data.loc[:, each] = (test_data[each] - mean)/std"
138139
]
139140
},
140141
{

0 commit comments

Comments
 (0)