Last answered:

02 Dec 2021

Posted on:

01 Dec 2021

0

wcss calculation for multiple k-values

I cannot replicate the problem of calculating wcss for 6 different k-values for clustering.
The lecture produces the following results:
image
while lmy results show:

image.png

It is not clear what is being used as the  input data - but assuming just the Longitude and Latitude vs country only there wcss values should be replicated.
Please help.

thanks,
Isaac

1 answers ( 0 marked as helpful)
Instructor
Posted on:

02 Dec 2021

0

Hey Isaac,

Thank you for your question!

Given the information I have, what I can suggest is that you try to run the notebook from the resources called "6_4_how-to-choose-the-number-of-clusters-notebook". Simply open it and choose Cell -> Run All. See if you get the same values as those in the lesson. When I run it myself, the output is the same as the one presented.

Let me know how it went.

EDIT: Note that there is a KMeans parameter called random_state which, if set to None (by default), initializes the centroids randomly. Set this parameter to an integer of your choice to get the same output every time you run the code.

Kind regards,
365 Hristina

Submit an answer