Session Ready
Exercise

Fitting and testing the model

In the previous exercise, you split the dataset into X_train, X_test, y_train, and y_test. These datasets have been pre-loaded for you. You'll now create a support vector machine classifier model (SVC()) and fit that to the training data. You'll then calculate the accuracy on both the test and training set to detect overfitting.

Instructions
100 XP
  • Import SVC from sklearn.svm and accuracy_score from sklearn.metrics
  • Create an instance of the Support Vector Classification class (SVC()).
  • Fit the model to the training data.
  • Calculate accuracy scores on both train and test data.