Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pre-assigned the centriods #136

Closed
makcedward opened this issue Jan 3, 2022 · 10 comments · Fixed by #137
Closed

Support pre-assigned the centriods #136

makcedward opened this issue Jan 3, 2022 · 10 comments · Fixed by #137

Comments

@makcedward
Copy link
Contributor

makcedward commented Jan 3, 2022

KMeans from sci-kit learn init parameters allows array. Does KMedoids also support it? I can submit pull requests for it

If an array is passed, it should be of shape (n_clusters, n_features) and gives the initial centers.

@TimotheeMathieu
Copy link
Contributor

KMedoids does not support array in init for now, you are welcome to PR for it. Mainly you have to add the code in _initialize_medoids, add docstring and also add a test to verify that it works.

I'm looking forward to your PR.

@makcedward
Copy link
Contributor Author

@TimotheeMathieu
Can you advise how can I run test cases in local env

@TimotheeMathieu
Copy link
Contributor

You have to make some pytest compatible tests (look at examples in the existing tests). Then, to run the tests locally, execute pytest while being in the sklearn-extra directory should run the tests, another possibility is to do the pull request directly and the tests will run automatically in the github checks.

@makcedward
Copy link
Contributor Author

makcedward commented Jan 3, 2022

Here is the PR

@TimotheeMathieu TimotheeMathieu linked a pull request Jan 4, 2022 that will close this issue
@PedroMTQ
Copy link

PedroMTQ commented Jan 3, 2023

I think this is not working atm:
_check_init_args doesn't allow for array like structures:
ValueError: init needs to be one of the following: ['random', 'heuristic', 'k-medoids++', 'build']

@TimotheeMathieu
Copy link
Contributor

are you sure that you installed the github version ? This is not released yet, you have to install the git version of scikit-learn-extra for this to work.

@PedroMTQ
Copy link

PedroMTQ commented Jan 3, 2023

You're right. It works after installing with pip install git+https://github.com/scikit-learn-contrib/scikit-learn-extra

@rth
Copy link
Contributor

rth commented Jan 3, 2023

@TimotheeMathieu Do you have a PyPI account ? I should add you as a maintainer there, so you can publish a new release if needed.

@TimotheeMathieu
Copy link
Contributor

Yes, my account is TMathieu. Although, I am not sure what is the future of this project as there does not seem to be anyone else contributing, but I can do a release.

@rth
Copy link
Contributor

rth commented Jan 3, 2023

I sent you the PyPI invite, thanks for your work @TimotheeMathieu !

Well, there are a few PRs and ~300 repos that depend on this package so there is some interest. Sorry myself I stepped down from scikit-learn maintenance including this repo to move to other projects. But if you have a chance you should talk with people at the scikit-learn foundation, to see how to best move forward, particularly since most people involved are at INRIA in France also. I'll follow up on this by email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants