# Time Series and XGBoost

I have time series data for two and half year. I am performing xgb.cv (from Jan 2014 to March 2016) and its giving very good result, but when I am using new data (April 2016 to June 2016) to predict, the accuracy is getting worse. I am using R xgboost package. Any suggestion on improving accuracy?

• Are you saying that the model works well on the data that was used to train it, but not as well on new data ? If so, that is to be expected. Further, one technique is to divide the training data into a training set and a validation set. Train on the training set and use the validation set to fine tune the model. Finally get accuracy on the test set. – aginensky Nov 19 '16 at 15:15
• @aginensky: Will xgb.cv be good technique to tune the model or should we go from grid search or something else – user3713850 Nov 19 '16 at 15:17
• I'm very far from an expert on the use of boosting with times series. However, in general, I'm a fan of using caret and it's parameters for tuning models. I'm not sure I understand your questions. For every possible value of the tuning parameter, typically one uses cv or something to estimate predictive accuracy. How does on pick the specific values that one will check with cv ? Grid search would be one obvious method. – aginensky Nov 20 '16 at 15:47
• how many rows do you have? Can you point to a decent proxy/toy in publicly available data? In my limited experience, xgb loves lots of rows (tens of thousands) and a very low learning rate $(0.001 \gg x)$ for good generalization. – EngrStudent Mar 6 '17 at 17:36