I think there is an error in the plotting file for this week, I had to change two lines to make it work on the example of kmeans, due to some unpacking of values after the "np.where(...)" (lines ~22-23).
I changed to the following lines
$$\mathrm{rows = np.where(assignments == k_th)}$$
$$\mathrm{ rows = rows[0]}$$
My issue was that the result from where(...) was a tuple with one entry, so I could not unpack the result to two values, but it was still a tuple, so there was an issue afterwards if I just removed the unpacking, so I added the second line.
Bug in the plotting function ?
Good evening,
I think there is an error in the plotting file for this week, I had to change two lines to make it work on the example of kmeans, due to some unpacking of values after the "np.where(...)" (lines ~22-23).
I changed to the following lines
$$\mathrm{rows = np.where(assignments == k_th)}$$
$$\mathrm{ rows = rows[0]}$$
My issue was that the result from where(...) was a tuple with one entry, so I could not unpack the result to two values, but it was still a tuple, so there was an issue afterwards if I just removed the unpacking, so I added the second line.
4
Add comment