0
0
ML Pythonprogramming~10 mins

Why classification predicts categories in ML Python - Test Your Understanding

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

Complete the code to import the classification model from scikit-learn.

ML Python
from sklearn.[1] import LogisticRegression
Drag options to blanks, or click blank then click option'
Alinear_model
Bdatasets
Ccluster
Dpreprocessing
Attempts:
3 left
2fill in blank
medium

Complete the code to train the classification model on data X and labels y.

ML Python
model = LogisticRegression()
model.[1](X, y)
Drag options to blanks, or click blank then click option'
Apredict
Btransform
Cfit
Dscore
Attempts:
3 left
3fill in blank
hard

Fix the error in the code to predict categories for new data points.

ML Python
predictions = model.[1](new_data)
Drag options to blanks, or click blank then click option'
Apredict
Bfit
Ctransform
Dfit_predict
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a dictionary of word lengths for words longer than 3 letters.

ML Python
lengths = {word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to create a dictionary of uppercase words mapped to their counts if count is greater than 0.

ML Python
result = { [1]: [2] for k, v in data.items() if v [3] 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk
Attempts:
3 left