-
Notifications
You must be signed in to change notification settings - Fork 7
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
question or to discuss: how to find optimal parameters of xgb? #7
Comments
Instead of varying |
Early stopping param is not supported in scikit-learn wrapper yet... maybe we can ask whether he want to support those params in scikit-learn wrapper. :) |
Parameters :
All these parameters can prevent overfitting, how to choose them. When tuning parameters, can we just tune one (few) of them? |
FYI Most time default parameters works pretty well. |
First you need to find stable eta. By stable i mean that you get aproximatively the same results on your choosed Metrics if you re-run the code. It depends of your data, same about CV. Then make a sequential loop for finding the best max_depth (usually independant of the other parameters). Then gridSearch or sequential loops for finding subsample and colsample. Now you've good hyper-parameters. Run you algo once again with a smaller eta (eg 0.01), depending of how much time you want to spend. Usually the smaller, the better. You definetly won't get the best hyper-parameters, but you will have good ones and more importantly in a decent time. You can also perform this steps with a smaller eta, therefore you'll be able to add more randomness (sample, colsample) but it will take more time. |
I usually do a grid search of the following parameter set:
param_grid = {
"learning_rate" : [ 0.1, 0.05, 0.01],
"n_estimators" : [ 100, 500, 1000],
"max_depth" : [ 4, 8, 12],
"min_child_weight" : [ 1, 5, 10],
"subsample" : [1, 0.8],
"colsample_bytree" : [1, 0.8]
}
Most time ppl can find a much better parameter set.
The text was updated successfully, but these errors were encountered: