xgbostrain()을 xgboost R 패키지에 사용하여 분류 모델에 맞 춥니 다. 나는 나무를 멈추는 최선의 반복이 무엇인지 알아 내려고 노력 중이다. early_stop_rounds = 6을 설정하고 각 반복의 메트릭을 살펴봄으로써 유효성 검사 데이터의 auc 성능이 최대 값에 도달 한 다음 그 값이 감소 함을 분명히 볼 수 있습니다. 그러나 모델은 멈추지 않고 지정된 nround에 도달 할 때까지 계속 진행됩니다.xgboost R 패키지 early_stop_rounds가 트리거되지 않습니다.
질문 1 : 유효성 검사 성능이 저하되기 시작하면 반복 할 때 정의 된 최상의 모델입니까?
질문 2 : 유효성 검사시 auc가 감소하기 시작하면 모델이 멈추지 않는 이유는 무엇입니까?
질문 3 : 매개 변수 최대화 = FALSE는 어떤 의미입니까? FALSE로 설정하면 멈출 것인가? early_stop_round가 설정되면 FALSE 여야합니까?
질문 4 모델은 주시 목록에서 유효성 검사 데이터가 어떤 모델인지 어떻게 알 수 있습니까? 나는 사람들이 test =, eval =, validation1 = 등을 사용하는 것을 보았는가?
감사합니다.
param<-list(
objective="binary:logistic",
booster="gbtree",
eta=0.02, #Control the learning rate
max.depth=3, #Maximum depth of the tree
subsample=0.8, #subsample ratio of the training instance
colsample_bytree=0.5 # subsample ratio of columns when constructing each tree
)
watchlist<-list(train=mtrain,validation=mtest)
sgb_model<-xgb.train(params=param, # this is the modeling parameter set above
data = mtrain,
scale_pos_weight=1,
max_delta_step=1,
missing=NA,
nthread=2,
nrounds = 500, #total run 1500 rounds
verbose=2,
early_stop_rounds=6, #if performance not improving for 6 rounds, model iteration stops
watchlist=watchlist,
maximize=FALSE,
eval.metric="auc" #Maximize AUC to evaluate model
#metric_name = 'validation-auc'
)