Mokani Aiml-8
Mokani Aiml-8
Mokani Aiml-8
Experiment No. 8
Problem Statement:
Selecting only the first two features for clustering and visualization:
Step 1: Define the number of clusters (k) and initialize random centroids for each cluster.
Step 6: Run multiple iterations of step 3 and step 4 (assign and update) for all the data
points in the dataset.
it=5 Specifies the number of times we will iterate over the step 3 and 4. In a typical
K-means algorithm, we continue iterating until the cluster centers do not change
significantly (i.e., until convergence). Here, I have limited it to 5 iterations for simplicity.