on 2024 Nov 21 2:25 PM
Hi,
I have a predictive analysis base that contains the forecast for 3 schools, showing the enrolled students in each one. My question is whether we can effectively add a variable that influences the results of this forecast and have this change reflected in the graph.
Thanks in advance,
Ganjos
Request clarification before answering.
Hi,
The short answer to your question is, yes, it is possible to add external variables to influence the forecast result. The exact way to do it depends on the precise functionally you are using to produce the forecast in SAP Analytics cloud. I will cover both cases.
One very important thing to note, that applies in all the cases mentioned below: if you want to use influencers (variables that influence the output of the forecast) you must be able provide influencers values for the whole forecast period. Let's assume that the tuition price influences the enrollments (as suggested in this post). The predictive model will be able to detect the correlation between the past tuition price and the number of enrollments but to produce a prediction for year 2025, the predictive model will need to know the expected tuition price in 2025 (for each school obviously).
The explanation provided below uses examples based on bike hires in London: these examples involve only one time series but everything works the same for several time series (bike hire in several cities, or enrollments in 3 schools for instance).
I - In story forecast
If you have simple forecasting needs, you can rely on the forecast features integrated in stories. By simple I mean: you only have a small number of distinct time series to forecast (up to 10) and you don't care about evaluating the forecast quality or getting detailed insights about the forecasted time series (trend, cycles, impact of the influencers...).
There are two distinct forecasting features integrated in stories:
Only Forecast in Time Series Chart allows leveraging influencers.
Currently forecast in planning table is not available in ODE.
How to leverage influencers (aka additional inputs, external factors...) in Forecast in Time Series:
In a "old story" you can enable time series forecasting using the contextual menu as shown below:
By default, you will get a forecast based on temporal factors only (trend, cycles...).
Note that you can forecast up to 10 time series this way in a single chart.
To leverage external factors (aka additional inputs or influencers) you must use the advanced options as shown below:
Add settings panel will open to the right. In this panel you can use the Add Additional Input link to select influencers. Click Apply at the bottom of the panel to validate the new settings.
Note that you can only select numerical values (measures or account) as influencer.
As you can see below the forecast is improved by adding the additional input.
However, if the measure/account you use as additional input doesn't increase significantly the forecast accuracy it will be ignored. You cannot force the predictive model to use an influencer that is actually not correlated to the target.
User experience is a little bit different in a optimized design experience story, but overall the principle remains the same.
II - Predictive Planning (Smart Predict for planning models)
If you have more advanced predictive needs you may want to use Smart Predict instead of the predictive features integrated in stories. Smart Predict is an automated predictive environment with a more complete set of capabilities.
Important Smart Predict capabilities:
If you need to produce forecast on a regular basis, Smart Predict can be scheduled using Multi Actions and SAC Calendar.
In this answer I will focus on the influencers exclusively, but if you need more information about using Smart Predict, you can refer to the following post: https://community.sap.com/t5/technology-blogs-by-sap/one-predictive-planning-amp-smart-predict-blog-...
Finally, note that "Smart Predict" is the generic name of the feature for creating predictive models in SAC, but is sometimes referred to as "Predictive Planning" when it is used to perform time series forecasting using planning models.
If you don't use influencer, you get the following forecast in Smart Predict:
You can add influencers using the Add Influencer link in the Influencers section of the predictive model setting:
Like previously the forecast is improved by adding the influencer:
In Smart Predict you can easily compare the two predictive models and see that the prediction error (Mean Absolute Percentage Error and Mean Absolute Error) is lower when influencers are used:
You can also see how the influencers impact the predicted target. The impact of rain on the bike hires is very straight forward, the more rain the fewer bike hires, as illustrated below:
Best Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ganjos,
What feature are you using to create your forecast? Smart Predict or forecast in chart?
Both have very different options and limitations.
Best,
Hi,
I assume that by " I can’t create more than one forecast", you mean that it's not possible to get more than one future forecast point (named "forecast periods" in the user interface).
The number of forecast period is limited by the number of available past points. If you want to increase the number of forecast periods, you need to get more past data points.
This has to do with the prediction interval (the blue shaded area around the forecast that informs you about the prediction uncertainty). Forecast in chart provides a prediction only if it's able to provide a prediction interval along with the prediction. The future in the future the prediction, the more past data points are need to calculate the prediction interval.
Regards,
Thanks for the answer. I created an example where I included more past dates. However, I encountered the following message: "Dotacoes_corrigidas is not considered in the forecast due to a lack of future values for dotacoes_corrigidas_acumuladas." Now, I’m able to predict more than one forecast period, but the additional variable I’m adding is still not being considered. Thanks in advance Ganjos
Hi Ganjos,
You must provide future values for all the influencer, for all schools and over the whole forecast horizon.
What do I call past and future? Past and future is defined by the last available data point for the target. Referring to the example below, the last available value for BikeHires (the measure we want to predict) is on August 25, 2015. This implies that any later date is "the future". The predictions will start on August 26, 2015.
This means that if you want to forecast using Temp. Mean and Rain as influencer, you must provide values for Temp. Mean and Rain starting from August 26, 2015 tup to the date of the last prediction.
In the example above it would be possible to get 6 forecast periods (August 26 to August 31) for the City Center area using Temp. Max and Rain as influencers. For the North area, it would be possible to get only 2 forecast periods as the Temp. Mean and Rain are available only for the next 2 days.
Note that by default, forecast in table tries to predict as many point as allowed by the number of past data points. As you must provide future values for the whole forecast horizon, you may want to reduce the number of forecast period using the Forecast Periods option in the advanced options:
Best,
Hi,
Forecast In Chart always uses the data as displayed in the chart.
In my example since data is displayed at the day granularity, data is processed at the day granularity and forecast is provided at the day granularity. If I want to get a forecast for the whole month I must request a 30 periods forecast, I will get 30 predictions corresponding to 30 days:
(Date hierarchy level is set to "day")
If I want to work at a month level I just have to change the chart configuration and display the data aggregated by month. In that case data is processed at the month level, and 1 period forecast corresponds to a 1 months forecast (1 predictions for one month):
(Date hierarchy level is set to "month")
Choosing the right time granularity is first a matter of how you want to consume the forecast. If you are interested in consuming the predicted value at the month level, then it's better to forecast at the month level directly than forecasting at the day level and then summing the result (because you are also summing the prediction error).
Regards.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.