7.1. Exercises
Testing your SVM RBF Knowledge
These two boundary plots were made using SVM with an RBF kernel and the other with K-Nearest Neighbours.

SVM True or False
Predicting with an SVM Classifier
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 used K-Nearest Neighbours to classify Pokรฉmon from the Pokรฉmon dataset so now letโs try to do the same thing with an RBF kernel!
Tasks:
- Create an
SVMmodel withgammaequal to 0.1 andCequal to 10 then name the modelmodel. - Train your model on
X_trainandy_train(Hint: you may want to use.to_numpy()). - Score your model on the training set using
.score()and save it in an object namedtrain_score. - Score your model on the test set using
.score()and save it in an object namedtest_score.