Emily's Hints for KMeans:

I found the assignment page fairly confusing, so I wrote up this to help you guys out.

General hints:

1. Gene class

2. Cluster class

3. KMeans class

KMeans algorithm

Step 1. initialize centroids randomly.

ENTER LOOP

Step 2. initialize/reset clusters. Step 3. assign genes to the closest centroid. Step 4. recompute centroids.

CHECK LOOP CONDITION: newly recomputed clusters != old clusters (tip: don't compare the centroids; doubles don't have perfect precision!)
RETURN to step 2 if clusters have changed. (Why?)
If clusters have not changed, exit loop.