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

machine_learning
xgboost
python

#1

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’


#2

@Amit_Sood, Have you downloaded the most recent version? Which OS are you working on?

PS: See this issue on the official repo


#3

I am using this on a mac and yes i did download the most latest version


#4

The issue you have pointed is still open with no response to it.


#5

Yes the issue is still open.

Try posting your problem on the same issue. Maybe they could help you.