Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the SVM classifier from scikit-learn.
ML Python
from sklearn.svm import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to create an SVM model with a linear kernel.
ML Python
model = SVC(kernel=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to train the SVM model on data X and labels y.
ML Python
model = SVC()
model.[1](X, y) Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a dictionary of predictions for each sample in X_test.
ML Python
predictions = {i: model.[1](X_test[[2]]) for i in range(len(X_test))} Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a dictionary of support vectors and their indices.
ML Python
support_info = {idx: vec for idx, vec in enumerate(model.[1]) if idx [2] len(model.[3])} Drag options to blanks, or click blank then click option'
Attempts:
3 left