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

Restructure all models to be sklearn friendly #101

Open
brenmous opened this issue Jul 2, 2020 · 0 comments
Open

Restructure all models to be sklearn friendly #101

brenmous opened this issue Jul 2, 2020 · 0 comments

Comments

@brenmous
Copy link
Collaborator

brenmous commented Jul 2, 2020

Scikit-learn has some strict rules about how models are structured:

  • all arguments explicitly listed in the init signature (no varargs)
  • has expected functions (fit, predict, etc.)
  • implements the get_params and set_params functions defined by BaseEstimator

Even if we inherit from a scikit-learn model, if these rules aren't followed than we aren't able to take advantage of scikit-learn utilities such as GridSearchCV optimisation, super-learner ensembles and some of the introspection/reflection functionality of models. You'll get an error along the lines of models must explcitily declare their parameters in init (no var args).

Sudipta got started on restructuring models to be compatible with GridSearchCV. These can be found in uncoverml.optimise.models. It requires tweaking to the mixins and for all parameters to be defined in the init. We should do the same for all models in uncoverml.models and then unify them all in uncoverml.models so we have a single models module. By following the work Sudipta has done it should be pretty straightforward (albeit time consuming) to complete this for all models.

The advantage is we no longer have the confusion of some models being duplicated and we can use all models with optimisation, superlearner ensembles etc.

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

No branches or pull requests

1 participant