Complete the code to import the clustering algorithm.
from sklearn.cluster import [1]
The KMeans class is used for clustering data points into groups.
Complete the code to fit the clustering model on data X.
model = KMeans(n_clusters=3) model.[1](X)
The fit method trains the clustering model on the data.
Fix the error in the code to predict cluster labels.
labels = model.[1](X)The predict method assigns cluster labels to data points after the model is fitted.
Fill both blanks to create a dictionary of cluster sizes.
cluster_sizes = {i: sum(labels [1] i) for i in range([2])}We count how many labels equal each cluster index from 0 to 2 (3 clusters).
Fill all three blanks to filter data points in cluster 1 with feature > 5.
filtered = [x for x, label in zip(X, labels) if label == [1] and x[[2]] [3] 5]
We select points where cluster label is 1 and the first feature (index 0) is greater than 5.
