AxeldeRomblay / MLBox

MLBox is a powerful Automated Machine Learning python library.
https://mlbox.readthedocs.io/en/latest/
Other
1.49k stars 274 forks source link

Specify Cross Validation Function #83

Closed rconnol closed 4 years ago

rconnol commented 5 years ago

I would like to be able to specify my own cross validation function. An example would be a time series dataset where I would want to use a cross validation like the following: https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.TimeSeriesSplit.html

I haven't dug into the code too much, but I did see where you statically define the cross validation function in the evaluate function, under the optimiser.py file.

Thoughts?

AxeldeRomblay commented 5 years ago

Hello @rconnol,

At the moment this feature is not available. Actually this is a choice I have made to avoid mistakes from the users when passing a cv object to the optimizer. Nevertheless, it is very easy to tweak the code, just override the following lines with your custom cv:

...And it should work as the score is computed using cross_val_score function from sklearn : https://github.com/AxeldeRomblay/MLBox/blob/master/mlbox/optimisation/optimiser.py#L424

Let me know if you still have some troubles ! Axel