Closed raymondj-pace closed 2 years ago
Please check that you use the last version of scikit-learn-extra, this feature was implemented in PR #137 .
Hmmm, Ok. I am using: scikit-learn-extra 0.2.0 py38ha53d530_1 conda-forge I'll see if pipy has a later version. Thanks.
I'm looking at: https://scikit-learn-extra.readthedocs.io/en/stable/generated/sklearn_extra.cluster.KMedoids.html
And I don't see it.
The PR is very new and hence you will not see this feature in the last stable release. Instead, it is in the "latest" doc : https://scikit-learn-extra.readthedocs.io/en/latest/generated/sklearn_extra.cluster.KMedoids.html and you can install the associated version of scikit-learn-extra with
pip install git+https://github.com/scikit-learn-contrib/scikit-learn-extra
Got it, thank you.
The sklearn.cluster.KMeans class has an 'init' parameter as does the sklearn_extra.cluster.KMedoids class.
sklearn.cluster.KMeans' init parameter allows a numpy array to be passed as the initial values for the centroids.
It would be useful if sklearn_extra.cluster.KMedoids could allow its 'init' parameter to also accept a numpy array as the initial centroids (medoids).
KMeans example:
Output: x1 = 0 x2 = 0 x3 = 0 x4 = 1 x5 = 2 x6 = 2 x7 = 2
I would like to be able to do the same with KMedoids and specify the initial medoids:
Output: ValueError: init needs to be one of the following: ['random', 'heuristic', 'k-medoids++', 'build']
Desired output: x1 = 0 x2 = 0 x3 = 0 x4 = 1 x5 = 1 x6 = 1 x7 = 1