Problem 3: Print Centroid Locations and Inertia
Easypython
Learn the Concept: K-Means ClusteringProblem Description
Write a Python program that fits a K-Means model with k=3 to a dataset and prints the final centroid locations and total inertia.
Input
A dataset with 3 visually distinct groups.
Output
The centroid locations and inertia value.
Constraints
- At least 9 data points.
Example Input
text(9 points forming 3 visually distinct groups)
Example Output
textCentroids: [[...], [...], [...]] Inertia: 12.5
Concepts Covered
.cluster_centers_, .inertia_.
Related Problems
- Problem 1: Apply K-Means with a Known Number of ClustersEasy · pythonSolve Problem
- Problem 2: Implement the Elbow MethodEasy · pythonSolve Problem
- Problem 4: Visualize K-Means Clusters and CentroidsEasy · pythonSolve Problem