kmeans.fit(x) does not have the same output
When I ran kmeans.fit(x), it only gives me KMeans(n_clusters=2) in the output, which differs from the output that is shown in the video. How do I fix this? Thanks.
Thank you for your question!
A parameter will be present in the output only if you change its default value. For example, the default number of clusters in
sklearn is 8. In your example, you have set the number of clusters to 2, which is different from the default value, so that parameter shows up in the output. The rest of the parameters have their default values. If you, for example, change the
random_state, that parameter will show up:
If you wish to display the values of all parameters, then you need to apply the get_params() method in just the same way as for the other algorithms.