Forecast Graph
The examples shown in this page are for illustrative purposes only. There is lots of room for improvement to the UI/UX that these examples show. When partnering with Inventory Optimization and Resolve, we work closely together to make sure the solution fits the partner's software, requirements, and user preferences. The end result will look different from the examples shown here.
The below image shows how a forecast graph can be implemented with the option for users to manually adjust the forecasted quantities. It's just an example, and we encourage partners to adapt this to their UI and the needs of their users. The important part is that the forecasted quantities are shown to the user in a clear and understandable way, and that the user has the option to adjust them. If adjustments are made, the purchase order suggestion should be recalculated with the Real Time Prediction endpoint.
Creating a Forecast Graph
To create a forecast graph, you need to have a forecast generated by the API. Follow the steps in Prediction to generate and fetch a forecast. With the results, follow these steps to create a forecast graph:
- The response from the Results endpoint includes the forecast data. This data includes a forecast object for each future time step in the horizon. A forecast object contains the date, predicted quantity, season, trend, noise, lower quantity, and upper quantity.
- The response also includes the historical data. This data can be used to plot the historical quantities leading up to the forecast.
- Use a graphing library in your programming language of choice to plot this data. The x-axis will represent the dates and the y-axis will represent the quantities.
- Plot the actual quantities as the main line on the graph, and the predicted quantities as a second line.
- The lower and upper quantities can be used to create a shaded area around the forecast line, representing the range of uncertainty for the forecast.