0
0
ML Pythonprogramming~10 mins

Why unsupervised learning finds hidden patterns 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 correct library for clustering.

ML Python
from sklearn.cluster import [1]
Drag options to blanks, or click blank then click option'
ALinearRegression
BDecisionTreeClassifier
CRandomForest
DKMeans
Attempts:
3 left
2fill in blank
medium

Complete the code to fit the KMeans model on data X.

ML Python
model = KMeans(n_clusters=3)
model.[1](X)
Drag options to blanks, or click blank then click option'
Afit
Bpredict
Ctransform
Dscore
Attempts:
3 left
3fill in blank
hard

Fix the error in the code to get cluster labels after fitting.

ML Python
labels = model.[1]_
Drag options to blanks, or click blank then click option'
Alabels
Bpredict
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a dictionary of cluster sizes.

ML Python
cluster_sizes = {i: sum(labels [1] i) for i in range([2])}
Drag options to blanks, or click blank then click option'
A==
B!=
C3
D5
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to create a dictionary of cluster centers with their coordinates.

ML Python
centers = {i: model.cluster_centers_[[1]] for [2], i in enumerate([3])}
Drag options to blanks, or click blank then click option'
Ai
Bidx
Crange(3)
Dlabels
Attempts:
3 left