6.1. Exercises
True or False: Scoring with Cross-Validation
Scoring and Cross Validation
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.
Letโs bring back the Pokรฉmon dataset that we saw in exercise 15.
Weโve built our pipeline and looked at the classification reports but this time we want to do cross-validation and look at the scores from cross-validation of not just accuracy, but precision and recall as well.
Tasks:
- Build a pipeline containing the column transformer and an SVC model and set
class_weight="balanced"in the SVM classifier. Name this pipelinemain_pipe. - Perform cross-validation using
cross-validateon the training split using the scoring measures accuracy, precision and recall. - Save the results in a dataframe named
multi_scores.