ishido
ishido

Reputation: 4245

(Python) XGBoost: Early stopping with cross validation?

Does the XGBoost package in Python allow for early stopping when using its cross validation function?

I read that the R package does this, but when I include early_stopping_rounds=10 in my xbg.cv() it gives me the error:

TypeError: 'set' object does not support indexing

Upvotes: 0

Views: 1444

Answers (1)

I was having same problem. I changed metrics={'xxx'} to metrics=['xxx'] and it worked. Strange behavior, because before I put the early_stopping_rounds, metrics={'xxx'} was working.

Upvotes: 2

Related Questions