Solved – nround parameter in xgboost

boostingmachine learning

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

Best Answer

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.

Related Question