josephsdavid / N2D

Library implementation of https://arxiv.org/abs/1908.05968v5
https://n2d.readthedocs.io/en/latest/
MIT License
23 stars 6 forks source link

Feature suggestion: compatibility with scikit-learn API #4

Closed uweschmitt closed 5 years ago

uweschmitt commented 5 years ago

Thanks for the work!

Did you consider to implement thescikit-learn API for clustering scrictly?

In your case this would mean to implement methods fit and fit_predict. The benefit would be that it is easier to get started with your code when you know scikit-learn already, and that one could swap clustering algorithms easily.

UMAP follows this API also: https://umap-learn.readthedocs.io/en/latest/basic_usage.html and keras implements a special wrapper https://keras.io/scikit-learn-api/. It appears that the scikit-learn API becomes a quasi standard in Python based ML libraries.

As your code is already published, you could avoid breaking existing code by offering a helper module like n2d.sklearn which would implement the suggested changes.

josephsdavid commented 5 years ago

Hey! This is a great idea! Some sort of compatibility with sklearn would make this way more useable, and just changing the methods in the N2D wrapper class could get all that going! I’ve got to knock out a research proposal this weekend but I will keep this issue open until we figure something out! Feel free to make a PR if you want to help out :)

josephsdavid commented 5 years ago

Love the idea of n2d.sklearn, ill think about if that’s worth it or not (only been around for about a week, so I doubt there’s a lot of production use so far) over the next couple of days, but definitely think this is a great idea to move forward!

josephsdavid commented 5 years ago

Started a sklearn branch! Will get this together over the next week or so :)

josephsdavid commented 5 years ago

Got the code properly set up, once I update the documentation and examples will merge with master!