Xgboost: AttributeError: module 'xgboost' has no attribute 'XGBRegressor'

Created on 12 Oct 2016  路  1Comment  路  Source: dmlc/xgboost

import xgboost as xgb

xgb.XGBRegressor(max_depth=3, learning_rate=0.1, n_estimators=100, silent=True, objective='reg:linear', nthread=-1, gamma=0, min_child_weight=1, max_delta_step=0, subsample=1, colsample_bytree=1, colsample_bylevel=1, reg_alpha=0, reg_lambda=1, scale_pos_weight=1, base_score=0.5, seed=0, missing=None)
Traceback (most recent call last):

File "", line 1, in
xgb.XGBRegressor(max_depth=3, learning_rate=0.1, n_estimators=100, silent=True, objective='reg:linear', nthread=-1, gamma=0, min_child_weight=1, max_delta_step=0, subsample=1, colsample_bytree=1, colsample_bylevel=1, reg_alpha=0, reg_lambda=1, scale_pos_weight=1, base_score=0.5, seed=0, missing=None)

AttributeError: module 'xgboost' has no attribute 'XGBRegressor'

Environment info

Python 3.5.2 :: Anaconda 4.2.0 (x86_64)

Most helpful comment

Hi amitsood,

I had a similar issue but my problem was because i named my python file xgboost.py

>All comments

Hi amitsood,

I had a similar issue but my problem was because i named my python file xgboost.py

Was this page helpful?
0 / 5 - 0 ratings