0
0
ML Pythonprogramming~10 mins

Support Vector Machine (SVM) in ML Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
ASVC
BSVR
CSVMClassifier
DLinearSVC
Attempts:
3 left
2fill in blank
medium

Complete 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'
A'rbf'
B'poly'
C'linear'
D'sigmoid'
Attempts:
3 left
3fill in blank
hard

Fix 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'
Atrain
Btransform
Cpredict
Dfit
Attempts:
3 left
4fill in blank
hard

Fill 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'
Apredict
Bi
C0
DX_test
Attempts:
3 left
5fill in blank
hard

Fill 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'
Asupport_vectors_
B<
Csupport_
D>
Attempts:
3 left