What is the difference between kilometers and kilometers2 in stingy?

I am new to machine learning and reflect on the difference between kilometers and kmeans2 in scipy. According to the document, both of them use the "k-means" algorithm, but how to choose them?

+7
python scipy machine-learning k-means
source share
1 answer

Based on the documentation, it seems that kmeans2 is a standard k-means algorithm and works until it reaches a local optimum - and allows you to change the initialization of the seed.

The kmeans function will end earlier, based on the absence of changes, so it may not even reach a local optimum. In addition, the purpose of this is to create a codebook for matching feature vectors. The codebook itself is not necessarily generated from a breakpoint, but will use the lowest β€œdistortion” iteration to generate the codebook. This method will also run kmeans several times. For more information, see the documentation.

If you just want to run the k-tool as an algorithm, select kmeans2. If you just need a codebook, select kmeans.

+4
source share

All Articles