3.1. Exercises

Using Sklearn to Obtain Different Measurements

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.

This time with our basketball dataset we are predicting multiple positions, in the last one we used only β€œForward” or β€œGuard” as our target labels and now we have 6 positions instead of 2!

Tasks:

  • Print a classification report of all the measurements comparing y_valid and predicted_y. You can use the digits function to round all the calculations to 3 decimal places.
  • Using zero_division=0 will suppress the warning.
Hint 1
  • Are you using the arguments y_valid, predicted_y, and digits=3 for the classification_report function?
Fully worked solution:


Multi-class Questions

404 image

For the next questions use the confusion matrix above and assume that Forward is the positive label.

True or False: Measurements