rodrigo-arenas / Sklearn-genetic-opt

ML hyperparameters tuning and features selection, using evolutionary algorithms.
https://sklearn-genetic-opt.readthedocs.io
MIT License
289 stars 73 forks source link

[Feature] Enable scikit-learn's BaseSearchCV #9

Closed rodrigo-arenas closed 3 years ago

rodrigo-arenas commented 3 years ago

Is your feature request related to a problem? Please describe. Currently the sklearn_genetic.GASearchCV has an inheritance from ClassifierMixin, RegressorMixin, but it should actually be from BaseSearchCV to be compatible with methods implementen in classes like GridSearchCV.

Describe the solution you'd like The request is to implement this inheritance, deprecate the methods or logic that are unnecesary to code explicitly like .predit, .predict_proba, .predict_log_proba and so on. This should implement the method ._run_search to work propertly. Take into account that it has to keep all the information from all the generations that the GASearchCV was running

Describe alternatives you've considered Review the sckit-learn GridSearchCV and RandomizedSearchCV to have a more clear way to go

Additional context scikit-learn base implementation: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/model_selection/_search.py

rodrigo-arenas commented 3 years ago

As mentioned in PR #31, the GASearchCV class now has inheritance from BaseSearchCV, but it's still missing some features, the most important one, it's the implementation of the cv_results_ property