austinwiltshire / scikit-optimize

Sequential model-based optimization with a `scipy.optimize` interface
https://scikit-optimize.github.io
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bugfix/list of dicts support #1

Closed austinwiltshire closed 4 years ago

austinwiltshire commented 4 years ago

Passing in a list of dicts for the parameter space resulted in cvresults not being able to be converted to a dataframe. This was due to some parameter fit runs not always using all parameters, such as the case with sklearn's SVM's different kernels.

Using list.extend only actually added things to a list in the cv_results dictionary when the field was there, and the lists often got out of sync with each other, making the resulting dictionary of lists unable to be consumed by pandas.DataFrame

This uses the approach found in sklearn.gridsearch of masked arrays, and keeping track of the index we're actively filling in the resulting dictionary of masked arrays to keep everything aligned.

austinwiltshire commented 4 years ago

Unfortunately scikit optimize isn't being maintained and their unit tests don't appear to run.

I'll be exercising the code inside ensemble though in tests there, is that good enough @CoitThomas ?

CoitThomas commented 4 years ago

Yeah, if ensemble tests are able to verify then that's good enough for me 👍