I want to predict sales in food-vending machines (to ultimately prevent food waste). I work with scikit learn
.
My current models are not too bad, but they show seasonal patterns for underprediction (and reciprocally for overprediction). The graph shows the monthly ratio of (underprediction==True)/(observations)
for one model (linear regression):
The graph looks similar for the other models I have tested (Ridge(), Lasso(), AdaBoostRegressor(), GradientBoostingRegressor(),
ExtraTreesRegressor(), RandomForestRegressor(), ElasticNet(), KNeighborsRegressor(), DecisionTreeRegressor()
). Everywhere I see patterns such as the ratio of underpredictions in May and June are higher than April and July. Or the ratio is always higher in December than in January.
What can I do so that the model picks up this pattern?
To ultimately reduce under- and overprediction and increase the model fit.
Maybe add a feature/trend - but how?
Some stylized facts:
- Target:
food items sold (per day)
- Features:
company, month, day in month, location within company (categorical), canteen (binary), no. of employees, company type, school holiday (binary), bank holiday (binary), day of week
- Observations: 34,000 (42 vending machines)
- Time range: 2010-2015
Planned steps after modelling underprediction:
- Fit above mentioned models with default parameters in cross validation and pick model with lowest avg. MSE and lowest standard error (
cross_validation.KFold(n=rows, n_folds=5, shuffle=True)
) - Run Grid Search on the chosen model for hyperparameter tuning