0
$\begingroup$

It's a generic question on tuning hyper-parameters for XGBClassifier() I have used gridsearch but as my training set is around 2,00,000 it's taking huge time and heats up my laptop.

I need codes for efficiently tuning my classifier's parameters for best performance.

$\endgroup$
3
  • $\begingroup$ can you post your code i.e you are using for gridsearch ??? $\endgroup$ Commented Jun 9, 2017 at 11:11
  • $\begingroup$ Sure. I am using a slightly modified version of the code given here: codiply.com/blog/… I just commented other models and inserted XGBClassifier there and in parameters I wrote {'n_estimators':[10,20,10,500], 'learning_rate':[0.3,1,10 **etc** $\endgroup$
    – vizakshat
    Commented Jun 9, 2017 at 11:21
  • 1
    $\begingroup$ look at these tutorials they explained it very well . Tune the Number and Size , Tune Learning Rate , you can also try Multithreading Support for Xgboost. $\endgroup$ Commented Jun 10, 2017 at 18:28

1 Answer 1

0
$\begingroup$

Its kind of difficult to avoid a large processing time when you have many parameters and a large sample.

A better method than gridsearch is Bayesian Optimization, this library even has done examples for xgboost ( https://github.com/fmfn/BayesianOptimization )

A good trick as well is to take a reduced sample of your data set, if you have over 2 million samples, you might acquire very similar results with smaller subsets (given that they have a similar distribution).

$\endgroup$
1
  • $\begingroup$ Taking subsets is what I did for my gridsearch. thanks $\endgroup$
    – vizakshat
    Commented Jun 14, 2017 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.