Complete the code to import the SVM classifier from scikit-learn.
from sklearn.[1] import SVC
The SVM classifier is in the svm module of scikit-learn.
Complete the code to create an SVM classifier with a linear kernel.
model = SVC(kernel=[1])The linear kernel is specified by the string 'linear'.
Fix the error in the code to fit the SVM model on training data.
model.[1](X_train, y_train)The method to train the model is fit.
Fill both blanks to create a dictionary of predictions for each test sample and calculate accuracy.
predictions = model.[1](X_test) accuracy = accuracy_score(y_test, [2])
Use predict to get predictions, then pass them to accuracy_score to compute accuracy.
Fill all three blanks to create a TF-IDF vectorizer, transform text data, and train the SVM model.
vectorizer = TfidfVectorizer([1]=1, [2]=0.9) X_train_tfidf = vectorizer.[3](train_texts) model.fit(X_train_tfidf, train_labels)
min_df and max_df set frequency thresholds for words. fit_transform learns vocabulary and transforms texts.
