param = {'max_depth': 2, 'eta': 1, 'silent': 0, 'objective':
'multi:softmax', 'num_class': 10}
num_round = 1
res = xgb.cv(param, dtrain, num_round, nfold=10,
metrics={'merror'}, seed=0, verbose_eval=True,
callbacks=[xgb.callback.print_evaluation(show_stdv=True),
xgb.callback.early_stop(3)])
I can see a lot of the following logs:
[17:50:22] src/tree/updater_prune.cc:74: tree pruning end, 1 roots, 4 extra nodes, 0 pruned nodes, max_depth=2
[17:50:22] src/tree/updater_prune.cc:74: tree pruning end, 1 roots, 6 extra nodes, 0 pruned nodes, max_depth=2
......
Finally, I print out res as following:
[0] train-merror:0.800139+0.00308927 test-merror:0.815893+0.0139572
My question is that:
1, What does the train-merror:0.800139 and test-merror:0.815893 mean? Is it the mean value of 10 folder's eval data?
2, When do we need to set num_round > 1? I did a misunderstanding about the num_round between cv() and train(). When cv(), num_round just do another 10 folder cross validation again. But when train(), num_round set the tree counts I want. Is that right?
3, When cv(), in one iteration, when does the process end if I do not set early stoping?
4, How can I print some metric when a folder process end?
Thank you!