3.1. Exercises
Name that Scaling Method!
Scaling True or False
Practicing Scaling
Instructions:
Running a coding exercise for the first time could take a bit of time for everything to load. Be patient, it could take a few minutes.
When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.
Make sure you remove the hash (#) symbol in the coding portions of this question. We have commented them so that the line wonβt execute and you can test your code after each step.
Now that we have a basketball dataset that no longer is missing any values, letβs scale the features.
First, letβs scale using standardization.
Tasks:
- Build the transformer and name it
ss_scaler. - Fit and transform the data
X_trainand save the transformed feature vectors in objects namedX_train_scaled. - Transform
X_testand save it in an object namedX_test_scaled. - Build a KNN classifier and name it
knn. - Fit your model on the newly scaled training data.
- Save the training score to 3 decimal places in an object named
ss_score.