Case 2: Four Distinct Clusters
Well, I think that the model did good work. But what if we try to divide the points into 4 groups?
Tarea
Swipe to start coding
- Import necessary libraries with their standard aliases. These are
pandas(pd),matplotlib.pyplot(plt),seaborn(sns), andKMeansfromsklearn.cluster. - Create a
KMeansmodel object with 4 clusters. - Fit the
datato themodel. - Predict the labels for
data. Save the result within the'prediction'column ofdata. - Build scatter plot for
'x'and'y'columns ofdatawith each point being painted with respect to the'prediction'column.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 5
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 3.57
Case 2: Four Distinct Clusters
Desliza para mostrar el menú
Well, I think that the model did good work. But what if we try to divide the points into 4 groups?
Tarea
Swipe to start coding
- Import necessary libraries with their standard aliases. These are
pandas(pd),matplotlib.pyplot(plt),seaborn(sns), andKMeansfromsklearn.cluster. - Create a
KMeansmodel object with 4 clusters. - Fit the
datato themodel. - Predict the labels for
data. Save the result within the'prediction'column ofdata. - Build scatter plot for
'x'and'y'columns ofdatawith each point being painted with respect to the'prediction'column.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 5
single