Skip to content

Commit e82c632

Browse files
authored
made small changes
1 parent 97548d0 commit e82c632

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ Navigate to `src/ex1_kmeans.py`. Implement the first part of the `plot_kmeans_cl
2626
2. k-means clustering is scale sensitive. This means that we generally need to rescale our input data before performing clustering. Note that our `plot_kmeans_clustering` function has a `standardize` parameter that is set to `False` by default. Standardize the data according to $x_i = \frac{x_i - \mu}{\sigma}$ where $\mu$ is the sample mean, $\sigma$ is the sample standard deviation, in case that `standardize` is set to `True`. `sklearn.preprocessing` may be helpful.
2727

2828
Now we want to perform k-means clustering. Implement the `perform_kmeans_clustering` function following these steps:
29+
2930
3. Use `sklearn.cluster.KMeans` to train on the given data. Set the parameter `init`, which controls the initialization of the cluster centers, to `random`. There is a better way to set this value, but we will discuss that in Task 3.
31+
3032
4. Retrieve the cluster centers and predict the cluster index for each point.
33+
3134
5. Return the inertia as a float, the cluster centers and the predicted cluster indices as an array each.
3235

3336
Go back to the `plot_kmeans_clustering` function and finish the remaining TODOs:

0 commit comments

Comments
 (0)