【发布时间】:2017-10-20 04:01:27
【问题描述】:
我在 ubuntu 的 Anaconda 上使用 python 3.6.2,并使用“pip install xgboost”和here的方法安装了xgboost(将pythonpath设置为库),但两者都不能工作,总是显示"
“模块”对象没有属性“XGBClassifier”
"
下面是我的代码:
cv_params = {'max_depth': [3,5,7], 'min_child_weight': [1,3,5]}
ind_params = {'learning_rate': 0.1, 'n_estimators': 1000, 'seed':0, 'subsample': 0.8, 'colsample_bytree': 0.8,
'objective': 'binary:logistic'}
optimized_GBM = GridSearchCV(xgb.XGBClassifier(**ind_params),
cv_params,
scoring = 'accuracy', cv = 5, n_jobs = -1)
【问题讨论】:
标签: python-3.x xgboost