128128 },
129129 "outputs" : [],
130130 "source" : [
131+ " # Save data for approximately the last 21 days \n " ,
132+ " test_data = data[-21*24:]\n " ,
133+ " \n " ,
134+ " # Now remove the test data from the data set \n " ,
135+ " data = data[:-21*24]\n " ,
136+ " \n " ,
131137 " quant_features = ['casual', 'registered', 'cnt', 'temp', 'hum', 'windspeed']\n " ,
132138 " # Store scalings in a dictionary so we can convert back later\n " ,
133139 " scaled_features = {}\n " ,
134140 " for each in quant_features:\n " ,
135141 " mean, std = data[each].mean(), data[each].std()\n " ,
136142 " scaled_features[each] = [mean, std]\n " ,
137143 " data.loc[:, each] = (data[each] - mean)/std\n " ,
138- " test_data.loc[:, each] = (test_data[each] - mean)/std\n "
144+ " test_data.loc[:, each] = (test_data[each] - mean)/std"
139145 ]
140146 },
141147 {
155161 },
156162 "outputs" : [],
157163 "source" : [
158- " # Save data for approximately the last 21 days \n " ,
159- " test_data = data[-21*24:]\n " ,
160- " \n " ,
161- " # Now remove the test data from the data set \n " ,
162- " data = data[:-21*24]\n " ,
163- " \n " ,
164164 " # Separate the data into features and targets\n " ,
165165 " target_fields = ['cnt', 'casual', 'registered']\n " ,
166166 " features, targets = data.drop(target_fields, axis=1), data[target_fields]\n " ,
459459 },
460460 "nbformat" : 4 ,
461461 "nbformat_minor" : 2
462- }
462+ }
0 commit comments