Complete the code to import the SVM classifier from scikit-learn.
from sklearn.svm import [1]
The SVC class is the standard Support Vector Classifier in scikit-learn used for classification tasks.
Complete the code to create an SVM model with a linear kernel.
model = SVC(kernel=[1])The kernel='linear' option tells the SVM to use a linear decision boundary.
Fix the error in the code to train the SVM model on data X and labels y.
model = SVC()
model.[1](X, y)train which is not a valid method.predict with training.The fit method trains the model on the data and labels.
Fill both blanks to create a dictionary of predictions for each sample in X_test.
predictions = {i: model.[1](X_test[[2]]) for i in range(len(X_test))}transform instead of predict.We use predict to get the prediction for each sample indexed by i.
Fill all three blanks to create a dictionary of support vectors and their indices.
support_info = {idx: vec for idx, vec in enumerate(model.[1]) if idx [2] len(model.[3])}support_vectors_ holds the vectors, support_ holds their indices, and we check if the index is less than the length of support_.
