Few of the features of bikesData data set may need Scaling. For example, if we see the values of features - temp, hum and windspeed - their values are in different scales (ranges), hence, we need to apply Scaling to these features values for our ML algorithms to work fine on them.
Please follow the below steps:
Please define a python list called
columnsToScale which contains list of features ( 'temp', 'hum', 'windspeed') which needs to be Scaled.
To apply 'Feature Scaling' on these features (columnsToScale), please create an instance of StandardScaler called
Complete and execute the below code by calling
fit_transform on train_set. We are basically training scaler(computing mean and other statistics) and then fitting it (i.e. applying it)
train_set[columnsToScale] = scaler.<<your code come here>>(train_set[columnsToScale])
Scale the test set using the scaler trained on train_set. Please notice that we are not calling fit.
test_set[columnsToScale] = scaler.transform(test_set[columnsToScale])
Now check the metrics values (mean, standard deviation, etc.) of the scaled features.
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here