Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
thierry_brunet
Product and Topic Expert
Product and Topic Expert
2,722


The predictive forecasts generated by SAP Analytics Cloud Predictive Planning are obtained from the analysis of the historical values of the variable to predict. This blog explains how predictive forecasts can be improved if there is a data context (I mean candidate influencers) around the variable to predict. The accuracy measured by the Horizon-Wide MAPE (see blog) of the predictive model can be better. The smaller it is, the more accurate the predictive forecasts are. Introducing a data context may also influence the characterization of the trend and of the cycle which will be more precise.


Today, SAP Analytics Cloud Predictive Planning does not take influencer variables into account. The goal of this blog is to explain how to use influencer variables to try to improve predictive forecasts and include them in the planning process.


Let me start from a planning model. I then call SAP Predictive Planning to create a predictive model and to get predictive forecasts. The predictive model and the predictive forecasts will be saved in the planning model. Then I create another predictive model that considers influencer variables. I compare these two predictive models and choose the one which provides the most accurate predictive forecasts. Finally, I show how to save these predictive forecasts into the planning process.


I illustrate my explanations using a bike rental example. The goal is to plan daily hires of bicycle rental in London. To do this I have historical data from 2011 to 20th September 2015. The table below shows for each day the number of bikes hired.



Fig 1: Planning model


Then I run SAP Predictive Planning from the planning model LondonBikeHire_Extended to get ten predictive forecasts from September 11th to September 20th 2015. So, I can compare actual values of the number of bikes hired with the predictive forecasts.

The predictive model I get has a HW-MAPE of 19.74%. In the figure below, only a linear trend and fluctuations are detected. However, there are no recurring cycles detected.


Fig 2: Decomposition of the evolution of number of bikes hired


This predictive model gives the forecasts shown below.


Fig 3: Predictive forecasts


The difference between the Error Max and the Error Min is the confidence interval. On average it is 23,314. It indicates how precise the predictive forecasts are. Now I save these predictive forecasts in a private version of the planning model.

I display actuals & forecasts side by side in a table. I filter on the predicted dates to focus on the comparison between the predictive forecasts for September and the actual values of the hire of bikes. The difference between these values between September 11th and September 20th is on average 11.46%.


Fig 4: Planning with predictive forecasts


Even if these predictive forecasts are accurate, I am not completely satisfied with them, because I feel that I have not used all the information I have. Since the beginning, I have recorded other information like:

  • Calendar information (index of the day in the month, is it a working day or a weekend, is it a day off …)

  • Weather information (temperature, pressure, is there sun, rain, or cloud …)

  • Event information (is it a day during Olympic games or during special event like football or rugby …)


In total, there are 66 other measures and dimensions, and I wonder if they have an influence on my bike hire activity. I want to try out whether including these influencers will improve my predictive forecasts. These measures and the number of bikes hired are recorded into a dataset.


Fig 5: Dataset with additional variables captured every day


I create a predictive scenario in SAP Smart Predict based on the dataset of figure 5. Then I check if the predictive forecasts are more accurate and I also discover which of my additional variables have the greatest influence. I then save my predictive forecasts into a new dataset, and I link this dataset to my planning story to display the predictive forecasts of my bikes hired. So, let’s do this now.

The settings of this predictive scenario are almost the same as those of SAP Predictive Planning. The differences:

  • The data source which is now a dataset and

  • The field “Exclude As Influencer” set to exclude a variable correlated to the date which does not bring information. I keep all other variables.



Fig 6: Setting of the predictive scenario


Once trained, the accuracy of the predictive model (HW-MAPE) has a value of 10.66%, which is better than the 19.74% obtained before. The accuracy of the predictive forecasts has increased by 46%.

This time, there are two changes as shown below. The trend is more precise, and is influenced by some of these additional variables. I discover that the trend is influenced at 34.94% by the maximum temperature during the day (daymax). The trend is also influenced at 15.70% if a bike is hired during a weekend, or during a bank holiday. The same way, the bike hire is influenced at 10.17% if it rains.



Fig 7: Decomposition of the evolution of bike hired


This predictive model gives the forecasts shown below.


Fig 8: Predictive forecasts


The confidence interval is on average equals to 14,567. It is 37.5% less than in the first predictive model. This also confirm the added value of using influencers.

Now I save my predictive forecasts into a dataset named LondonBikeHire_Predictions.


Fig 9: Dataset containing the predictive forecasts


The last step consists of linking this dataset with the planning model in the planning story. For this I just add a linked model with the dataset LondonBikeHire_Predictions and link it on the time dimension to the planning model LondonBikeHire_Extended, as show below.


Fig 10: Link planning model to dataset


To focus the attention of the predictive forecasts and their comparison with actuals, I filter the time dimension on September 2015. The comparison is done with these calculated measures:

  • Delta (% no influencer) is the difference in percentage between predictive forecasts done via SAP Predictive Planning and actual values of the number of bikes hired. The average of this measure is 11.46%.

  • Delta (% with Influencers) is the difference in percentage between predictive forecasts done when context is used in the predictive model and actual values of the number of bikes hired. The average of this measure is 6.95%.



Fig 11: Planning story with actuals and predictive forecasts generated with influencers


What can we conclude? In this case, there are additional variables which have had a positive impact on the accuracy of the predictive model. The Horizon-Wide MAPE is much better (+46%) as well as the confidence interval (+37.5%). This can also be directly confirmed by the smaller gap between predictive forecasts and actual values (39.3% smaller). It is in the interest of the planner to keep in his planning story, the predictive forecasts from the predictive model that were calculated with influencers.

So, in certain cases, adding influencers might help refine the accuracy of the predictive forecast. If this happens with your use cases, you now have a way to bring this added value to your planning stories.

I hope these steps will help save you some time in the future. If you appreciated reading this, I would be grateful if you left a comment to that effect, and do not forget to like it as well. Thank you.

Resources about SAP Predictive Planning:

 
7 Comments
marcel_reinsch
Product and Topic Expert
Product and Topic Expert
Hi Thierry,

thanks for your very interesting blog post.

Is it true, that you need to have those additional influencers already in the future (future= the time we want to predict)?

Just asking as you take e.g. the influencer "rain" - how can we already know that KPI in the future?

 

Thanks,

Marcel
achab
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Marcel, you are fully correct to this. While Predictive Planning cannot predict the future rain, you can place some estimates what's a typical weather might be like. To your point though by doing this, you move more to a form of simulation, and you can also do pessimistic/optimistic/middle scenarios. A whole range of possible applications! Kind regards, Antoine
achab
Product and Topic Expert
Product and Topic Expert
0 Kudos
And especially important in the disrupted times we are collectively going through.
Henry_Banks
Product and Topic Expert
Product and Topic Expert
 

marcel.reinsch antoine.chabert  because we are dealing with LondonBikeHire dataset, i have a 99.9% confidence interval that it will be raining here in the UK 😉  and 100% confidence that the British will be talking about the weather!

 

Thanks for the great blog thierry.brunet many thanks for putting this together and explaining the capabilities. sorry for the sidetrack!

Regards, H
achab
Product and Topic Expert
Product and Topic Expert
0 Kudos
Nice one :-). Sunny weather forecasted here for the week-end. I might go cycling! Cheers, Antoine
achab
Product and Topic Expert
Product and Topic Expert
0 Kudos
achab
Product and Topic Expert
Product and Topic Expert
0 Kudos
Please note we delivered a feature in the August 2021 release of SAP Analytics Cloud to support the use of influencers directly from the planning model. See a walk-through example here: https://blogs.sap.com/2021/06/30/leveraging-influencers-to-improve-your-predictive-forecasts-accurac....