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)