hyperopt / hyperopt-sklearn

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

AttributeError: module 'hyperopt' has no attribute 'pyll' #188

Closed CCChen-Menggg closed 2 years ago

CCChen-Menggg commented 2 years ago

Hello, I met the error when instantiating an estimator by HyperoptEstimator, below is the traceback.

hpsklearn==0.1.0 hyperopt==0.2.7 & 0.2.7, doesn't work neither

Traceback (most recent call last):

File "mytest.py", line 472, in results = hyperParamSearch(res_dir, 'hyperParamSearch', tunedParams, scores, method='tpe')

File "mytest", line 454, in hyperParamSearch result = RFmodelHyperOpt(Xtrain_set, Ytrain_Set, Xval_set, Yval_Set, tunedParams)

File "mytest", line 282, in RFmodelHyperOpt estim = HyperoptEstimator(regressor=random_forest_regression("my_clf", <-------------------------

File ".../anaconda3/lib/python3.8/site-packages/hpsklearn/estimator.py", line 523, in init self.space = hyperopt.pyll.as_apply({ <-------------------------

AttributeError: module 'hyperopt' has no attribute 'pyll' <-------------------------

Would you please give any clue about this and help fix this, many thanks!

CCChen-Menggg commented 2 years ago

It will be solved when pip install git+https://github.com/hyperopt/hyperopt-sklearn rather than pip install hpsklearn.