2017-10-20 1 views
1

우분투의 Anaconda에서 파이썬 3.6.2를 사용하고 있으며 "pip install xgboost"와 here의 메소드를 사용하여 xgboost를 설치했습니다 (pythonpath를AttributeError : 'module'객체에 아나콘다의 속성 '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) 

답변

1

가 이미 01을 사용하여이 문제를 해결 : 라이브러리), 그러나 모두가 작동하지 않을 수 있습니다 항상 "

'module' object has no attribute 'XGBClassifier'

"다음

내 코드를 보여줍니다

+0

이것은 작동합니다. 이 수정 후에 커널을 다시 시작하는 것을 잊지 마십시오. – Nib

관련 문제