hyperopt / hyperopt-sklearn

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

How can I specify separate validation data for the model fitting? #152

Closed statcom closed 4 years ago

statcom commented 4 years ago

fit method seems to perform cross-validation. Is there any way to have a separate validation data for the method?

bjkomer commented 4 years ago

There is, although fit is currently set up to take that separate validation data along with the training data as one array. You can choose the size of the validation set with the valid_size parameter of fit. Setting cv_shuffle=False means the last portion of the data will always be used as validation (this is False by default).

For example, if your training set is 40k samples and your validation is 10k, pass them together and use fit(X, y, valid_size=0.2, cv_shuffle=False)