hyperopt / hyperopt-sklearn

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

job exception: __init__() got an unexpected keyword argument 'presort' #174

Open muratonuryildirim opened 2 years ago

muratonuryildirim commented 2 years ago

Hi,

I am just running your following sample code:

from hpsklearn import HyperoptEstimator, any_classifier, any_preprocessing from sklearn.datasets import load_iris from hyperopt import tpe import numpy as np

iris = load_iris()

X = iris.data y = iris.target

test_size = int(0.2 * len(y)) np.random.seed(13) indices = np.random.permutation(len(X))

X_train = X[indices[:-test_size]] y_train = y[indices[:-test_size]] X_test = X[indices[-test_size:]] y_test = y[indices[-test_size:]]

estim = HyperoptEstimator(classifier=any_classifier('my_clf'), preprocessing=any_preprocessing('my_pre'), algo=tpe.suggest, max_evals=100, trial_timeout=120)

estim.fit(X_train, y_train)

print(estim.score(X_test, y_test)) print(estim.best_model())

However, I receive the following error: job exception: init() got an unexpected keyword argument 'presort' init() got an unexpected keyword argument 'presort'

Could you please help me about it?

Duonghailee commented 2 years ago

Hi, have you resolved this issue?

sergedegosson70 commented 2 years ago

@Duonghailee Have you managed to solve it? I got the same issue.

Duonghailee commented 2 years ago

@Duonghailee Have you managed to solve it? I got the same issue.

You can install hyper-opt from this version: pip install git+https://github.com/hyperopt/hyperopt-sklearn@fd718c44fc440bd6e2718ec1442b1af58cafcb18 , it should work.

zioalex commented 1 year ago

Did anybody solved this? The only way I found to solve it is with scikit-learn==0.23