1.1. Exercises
Name That Value!

True or False: Confusion Matrix
Code a Confusion Matrix
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.
Weβve seen our basketball dataset before and predicted using SVC with it before but this time we are going to have a look at how well our model does by building a confusion matrix.
Tasks:
- Build a pipeline named
pipe_bbthat preprocesses withpreprocessorand builds anSVC()model with default hyperparameters. - Fit the pipeline on
X_trainandy_train. - Next, build a confusion matrix using
plot_confusion_matrixand callingpipe_bbon the test set. Pick any colour you like withcmap. You can find the colour options here.