2016-06-18 3 views
3

내가 mlogloss에 따라, 초기 정지와 XGBoost.cv를 사용하는 것을 시도하고있다 :XGBoost CV 초 정지

params = {'booster': 'gbtree', 'objective': 'multi:softprob', 
      'num_class': len(le.classes_), 'eta': 0.1, 
      'max_depth': 10, 'subsample': 1.0, 
      'scale_pos_weight': 1, 'min_child_weight': 5, 
      'colsample_bytree': 0.2, 'gamma': 0, 'reg_alpha': 0, 
      'reg_lambda': 1, 'eval_metric': 'mlogloss'} 

res = xgb.cv(params, dm_train, nfold=5, 
     seed=42, early_stopping_rounds=10, verbose_eval=True, 
     metrics={'mlogloss'}, show_stdv=False) 

print(res) 
초 정지의 나의 이해 내 평가 메트릭 (n 개의 라운드 개선되지 않는 경우이다

이 경우 10) 실행이 종료됩니다. 이 코드를 실행하면 출력을 인쇄, 10 라운드 경기 종료 : (정확도 개선되어야로)

test-mlogloss-mean    
0:    6.107054    
1:    5.403606      
2:    4.910938     
3:    4.546221      
4:    4.274113     
5:    4.056968     
6:    3.876368    
7:    3.728714      
8:    3.599812     
9:    3.485113     

테스트 - mlogloss 따라서, 각 시대에 떨어지고, 나는 종료하지 않도록 실행을 기대했다. 내가 어디로 잘못 가고 있니?

감사합니다.

답변

1

num_rounds 매개 변수를 설정하지 않았습니다. 기본값은 10입니다. Simple.