hyperopt / hyperopt-sklearn

Hyper-parameter optimization for sklearn
hyperopt.github.io/hyperopt-sklearn
Other
1.59k stars 272 forks source link

Preprocessors aren't given `y` when fit #115

Open adodge opened 6 years ago

adodge commented 6 years ago

I'm trying to use the SelectKBest or SelectPercentile classes as preprocessors, but I'm finding that the preprocessors are fit with fit(X), not fit(X,y). Looking at the code, this seems to be a fairly baked-in assumption in places. I think I'll make an attempt at refactoring preprocessors a bit. This interacts with the issue raised in #104 (in that fitting at test time won't be possible if we're calling fit(X,y).)

adodge commented 6 years ago

See https://github.com/hyperopt/hyperopt-sklearn/commit/4d49c16d1525b54aeb79f958fd40546482fe3e65 for my attempt at SelectKBest and SelectPercentile components.