Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same param settings, differ in the length of eval_set, get different training result #4576

Closed
dtss316 opened this issue Jun 18, 2019 · 3 comments

Comments

@dtss316
Copy link

dtss316 commented Jun 18, 2019

Sample1:
input_param = {'booster': 'dart', 'colsample_bylevel': 0.4, 'colsample_bytree': 0.3, 'gamma': 0.9000000000000001, 'learning_rate': 0.1, 'max_delta_step': 2, 'max_depth': 2, 'min_child_weight': 2, 'n_estimators': 480, 'reg_alpha': 10, 'reg_lambda': 1, 'scale_pos_weight': 0.9, 'subsample': 0.6000000000000001}
model = xgbboost.sklearn.XGBClassifier(n_jobs=5, verbosity=0, **input_param)
model.fit(x_train, y_train, early_stopping_rounds=24, eval_metric=['auc'], eval_set=[(x_train, y_train), (x_train, y_train), (x_val, y_val)])
Sample2:
input_param = {'booster': 'dart', 'colsample_bylevel': 0.4, 'colsample_bytree': 0.3, 'gamma': 0.9000000000000001, 'learning_rate': 0.1, 'max_delta_step': 2, 'max_depth': 2, 'min_child_weight': 2, 'n_estimators': 480, 'reg_alpha': 10, 'reg_lambda': 1, 'scale_pos_weight': 0.9, 'subsample': 0.6000000000000001}
model = xgbboost.sklearn.XGBClassifier(n_jobs=5, verbosity=0, **input_param)
model.fit(x_train, y_train, early_stopping_rounds=24, eval_metric=['auc'], eval_set=[(x_train, y_train), (x_val, y_val)])

The only difference between sample1 and sample2 is eval_set.

@hcho3
Copy link
Collaborator

hcho3 commented Jun 19, 2019

Early stopping may be broken. Try disabling early stopping and see if the results are consistent. If so, we will need to fix early stopping. Can you post your script and data so that we can try to fix it?

@hcho3
Copy link
Collaborator

hcho3 commented Jul 3, 2019

@dtss316 Any updates?

@hcho3
Copy link
Collaborator

hcho3 commented Jul 4, 2019

See #4638, which addresses a bug in early stopping. I'm going to close this for now. Should you experience the same issue after #4638 is merged, feel free to re-open.

@hcho3 hcho3 closed this as completed Jul 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants