How to forecast product/item sales next one week using Xgboost regressor I have trained xgboost algorithm to predict the number of items sale on a given day and got pretty good results, now I would like to forecast sales ahead of one week. 

I tried re-training the algorithm by adding date as one of the independent variables, however, got an exception on date type. 

So can someone please suggest how to predict forecast item sales count next one week.

In-sample predictions code:

train_x,X_test,train_y,y_test=train_test_split(data,data_y,
                                               test_size=0.30)
xgb = xgboost.XGBRegressor(n_estimators=100, learning_rate=0.08, gamma=0, subsample=0.75,
     colsample_bytree=1, max_depth=7)
xgb.fit(train_x,train_y)
predictions = xgb.predict(X_test)
Yes, you cannot pass in a datetime object as a feature to XGboost Regressor, because it isn't time-series forecasting tool such as ARIMA. 

Instead, you create various features from the timeseries object such as year, month, day of month, day of week, number of days until public holiday etc. All of these are of type int. Drop the timeseries column. 

When you're passing in the test data, you convert the datetime object into the above features.