One of the most common uses of machine learning in analytics is to forecast time based data. It’s the quintessential sales question – what will my sales look like next month, or next quarter, or next year even – the proverbial crystal ball, if only it were that simple. Something that we were fairly quickly put together using MicroStrategy’s visual insights and R-Integration is an “Ordinary Least Squares” regression algorithm to fit the best curve that captures the general trend and seasonal variability of Walmart POS data to predict future sales.
The formula is:
Y = bTrend*Trend + Σ (bSeason_i*Seasoni) + bIntercept
- Y is a numeric metric (called the Dependent Variable)
- Trend is a numeric metric that’s an arithmetic sequence of monotonically increasing values
- Seasoni is a binary indicator metric derived from Season, a numeric or string metric that represents each season. Binary indicators have a value of 1 for the i-th season and are 0 for all other seasons. For n seasons, there are n-1 XSeason_i variables
- bTrend, bSeason_i, and bIntercept are coefficients determined by the regression algorithm.
As sales drop in for the coming months, we should be able to gauge the accuracy of our prediction for the rest of the year. If this hold true, we could use it for some of our business decisions going forward. We could also look at just the latest complete months, so we would not see that monthly drop in month 201402. We could also look at this weekly by switching out just a couple of metrics.
Something else we could do is create a variance against actual POS sales, and if the variance exceeds some number, like 10% difference plus or minus, we could create an alert and send out warning emails to key people in our business so that they can plan for unanticipated high sales, or research a drop in sales.
Please contact us to see how we can help you leverage regression analysis with your data to help predict your future!