2
$\begingroup$

i was implementing xgb code is like below,

bst <- xgboost(data = as.matrix(train.boost), label = lable.train, max.depth = 2, eta = 1, nthread = 2, nround = 20, objective = "binary:logistic")

so i am surprised with the result of xgb, especially with nround

nround when -> 5 it gave train-error:0.175896 [final pass]
nround when -> 10 it gave train-error:0.154723 [final pass]
nround when ->20 it gave train-error:0.114007 [final pass]
nround when ->30 it gave train-error:0.099349 [final pass]

I think when i am using nround as high number it is overfitting the data, So i am confused, I want to know how to choose ideal value of nround.

Thanks

$\endgroup$
1
  • 1
    $\begingroup$ eta = 1 is never the correct choice. Always use a learning rate $< 1$. $\endgroup$ Commented Nov 24, 2016 at 17:47

1 Answer 1

5
$\begingroup$

You can't see if the model is overfitting by using just the training data. You must use at least a validation set (or cross-validation) to estimate the performance of the model outside training and THEN you can tell if it's overfitting or not.

$\endgroup$

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.