I am trying to run xgboost using spyder and python, but I keep getting this error:
AttributeError: module ‘xgboost’ has no attribute ‘XGBRegressor’
Here is the code:
import xgboost as xgb
xgb.XGBRegressor(max_depth=3, learning_rate=0.1, n_estimators=100, silent=True,
objective='reg:linear', gamma=0, min_child_weight=1,
max_delta_step=0, subsample=1, colsample_bytree=1,
seed=0, missing=None)
Error is
Traceback (most recent call last):
File "<ipython-input-33-d257a9a2a5d8>", line 1, in <module>
xgb.XGBRegressor(max_depth=3, learning_rate=0.1, n_estimators=100, silent=True,
AttributeError: module 'xgboost' has no attribute 'XGBRegressor'
I have
Python 3.5.2 :: Anaconda 4.2.0 (x86_64)
How do I solve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…