Avsnitt 1. Kapitel 16
single
Challenge: Implementing K-Means Clustering
Svep för att visa menyn
Uppgift
Svep för att börja koda
You are given a synthetic dataset stored in the data variable.
- Initialize a K-means model with
3clusters, setrandom_stateto42,n_initto'auto'and store it in thekmeansvariable. - Fit the model on the dataset, predict the cluster labels, and store the result in the
labelsvariable. - For each cluster
i, extract the points belonging to this cluster and store the result in thecluster_pointsvariable.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 16
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal