Many 1s.jpg

The release of SAP BusinessObjects Predictive Analytics 3.0 opens the door to powerful time series forecasting scenarios!


Our straightforward wizard-based approach makes it possible to create and save time series predictive models via a few clicks.

Since 3.0 was released, it’s possible to derive many predictive models from this very first model, based for instance on different geographies or product lines. 

The periodic retraining of this segmented model on fresher data can be scheduled. All the resulting forecasts can be written to an output table, and generate added-value data.

These capabilities are available in a nice and intuitive SAP Fiori-based user interface, the SAP Predictive Factory.

In the following step-by-step example, let’s imagine a retailer running brick & mortar stores. This company wants to forecast the number of customer visits in each of their stores so that they can make sure that the stores are staffed adequately and that the customer demand can be fulfilled.

/wp-content/uploads/2016/06/273711_l_srgb_s_gl_982034.jpg

Everything starts with the creation of a time series analysis model.

Time Series Analysis.png

The source data used is stored in a SAP HANA table. The table contains the historical data of the store visits, per store, from July 2010 to June 2016. The data is aggregated at a monthly level.

Select a Data Source.PNG

The order of the data is based on the DATE variable. A filter is set on of one the stores to create the initial model.

Order and Filter.jpg

The model will be created on the data of the first store (nicknamed Store_1).

Filter on Store_1.png

The Target variable is named VISITS, it is the aggregated number of customer visits per month.

Selecting Variables.PNG

The forecast is required for the next year to come – this is specified as 12 forecasts, one per month that needs to be predicted.

Summary of Modeling Parameters.PNGWhen debriefing the model, the following can be noticed: 

– the number of customer visits contains a general trend and cycles, which have been described by the time series model

– the horizon-wide MAPE (Mean Absolute Percentage Error) is equal to 0,033. The error is only 3.3% which means that the time series model describes the signal accurately.


Debriefing the Model.PNG

When comparing the signal (the real customer visits) and the forecast, the accuracy of the model can be noticed.

Signal vs Forecasts.PNG

The time series model can be saved locally. It can also be saved in the SAP HANA database that contains the data.

Saving the Model.PNG

In SAP Predictive Factory, a project dedicated to customer visit forecasting has been created.

SAP Predictive Factory Project.PNG

The model that was saved earlier on is imported in the project.

Import the Models.PNG

Model Imported.PNG

The initial time series model can be segmented. It means that a separate time series model is going be created for each store. This segmentation capability is available only for time series models in the 3.0 release.

Segment Model.PNG

The model is segmented depending on the variable STORE, it is part of the SAP HANA table.

The reference date for the training is set to June 2016, it means that all the data up to the last data point measured in June will be used to train the segmented model. 

Save and Train.PNG

Set Reference Date.PNG


The segmented model is created. Please note that the creation of the model is delegated to SAP HANA, thanks to SAP HANA’s Automated Predictive Library. It means that the data is not being moved out of SAP HANA in the model training process.

Model Training in Progress.png

20 different models have been trained for each store. The performance of each model is displayed. The segmented model is set as the active one.

Segment Performance.PNG


Tasks make it possible to automatically refresh the segmented model and make sure up-to-date forecasts can be delivered.


A task is defined to:

  • Be run every month, as the source table will be enriched with new records month after month.
  • Use the 5 last years of historical data (before the reference date) to train the segmented model
  • Forecast the next 12 months after the reference date.

Task Definition.PNG


The forecasting task is scheduled to be executed on a monthly basis and deliver predictions for the next 12 months after the reference date.

Task Definition Schedule.PNG


The data corresponding to the next 12 months forecast can be written back in the SAP HANA database.

Task Output Table.PNG

For the purpose of the example, let’s run the task based on today’s date and forecast the customer visits for next year.

Run Task.PNG

Once the task has been run, the performance over the different segments is displayed. The top segment is Store_15 with 2.17% of error, while the segment with the least good performance is Store_9.

Task Run.PNG


The forecast can be compared to the historical data, for any of the stores, like shown below.

Store_Viz.PNG



As a conclusion to this step-to-step example, the SAP Predictive Factory represents a very powerful addition to the SAP BusinessObjects Predictive Analytics product family as it makes possible to create mass forecasting models, for instance for different geographies or product lines.


Similarly to this retail example, many applications can be imagined for manufacturing, telecommunications companies and in general every industry that requires visibility on the future!


We look forward to hearing from you on the business cases made possible with the SAP Predictive Factory!

To report this post you need to login first.

14 Comments

You must be Logged on to comment or reply to a post.

    1. Antoine CHABERT Post author

      Hello Ivan, thanks for your feedback!

      Predictive Factory is licensed as part of our SAP BusinessObjects Predictive Analytics Suite and requires a dedicated key code.

      Best regards,

      Antoine

      (0) 
  1. Erdem TIRELI

    Hi Antoine,

    Thanks a lot for this instructive tutorial that you have shared with us.

    I was wondering whether it is posibble to create separeted time series using Sql Server or text file or do we have to have the data on HANA as it’s HANA’s APL who trains the model?

    Erdem

    (0) 
    1. Antoine CHABERT Post author

      Hi Erdem,

      It’s an interesting question as people usually tend to do a too tight coupling between Predictive Factory and SAP HANA.

      All the data sources that are claimed as being supported in our 3.0 PAM by Automated Analytics are also supported by the Predictive Factory. This is not crystal-clear in the PAM, and I’ll make sure we fix this moving on.

      3.0 PAM link: https://support.sap.com/content/dam/library/ssp/infopages/pam-essentials/Pred_Ana_30.pdf

      Of course, as you mentioned the extra benefit of using SAP HANA, is that, provided that the APL library is deployed on your SAP HANA server, the creation of the models will be delegated to SAP HANA and thus, intensive data transfer between the SAP HANA and the SAP Predictive Analytics Server will be avoided.

      I hope this helps,

      Thanks & regards,

      Antoine

      PS: we have an internal community to support SAP employees 😉

      (0) 
  2. Data Geek

    Hello Antonie

    Thanks for the useful post. I have one query though.

    Can we have a connection between Predictive Factory and SAP BW?-so that we can store the KPI/Prediction back into BW. I know we score the Models in Factory-but we need to find a way to put it back into BW (and not just Factory).

    The other way was that Does SAP BW understand PMML? Because if it does-then we don’t even need Factory right (as even factory consumes PMML)? We can directly operationalise our model using PMML integration into SAP BW…I read one of the papers that ADAPA is used for integration wit SAP applications-but am not sure if it is used for integration of PMML with SAP BW…Let me know your opinion on this.

    Best Regards

    Data.Geek

    (0) 
    1. Jan Fetzer

      Hi Data.Geek,

      as Antoine mentions above, the data can be written back to the HANA database directly. BW on HANA would pull it up from just like any other DB table. By the same token, BW info providers can be generated into their HANA counterparts and PA then takes those as input to its modeling magic.

      Br, Jan

      (0) 
      1. Data Geek

        Hello Jan Fetzer.

        Can you direct me to a link where I can understand it in a more granular manner?

        I would like to understand how the data is written back to HANA-Is it via PMML? or something else… Does it mean that we don’t require Predictive Factory?

        But in another question-Can there be a link established between Factory and BW or other SAP System as we would like to operationalize the model not only in Factory but also in the internal company data system?

        Best Regards

        Ankit

        (0) 
        1. Antoine CHABERT Post author

          Hi Ankit,

          I will post a few papers/links worth reading on our HANA/ BW on HANA integration.

          @Jan_Fetzer is spot on.

          Not sure what you mean exactly by operationalizing the models and “internal company data system? Please be a little bit more explicit on this & post a dedicated, separate questions (as per SCN rules, let’s limit conversations in comments, thanks in advance).

          Thanks & regards,

          Antoine

          (0) 
        2. Jan Fetzer

          Hi Ankit,

          please drop me an email to <edited to remove email> and I’ll send you a document with more details. But in a nutshell: Factory tells PA server to retrain/apply/deviation test a model and then PA server decides what to do. For HANA it delegates to the APL and then initiates a write of the results via SQL. PMML does not come into play here.

          With APL being a function library within HANA, it can also be triggered via Stored Procedures. We have a customer managing those procedures from BW and integrating them via HANA Analysis Processes, thus doing all the scheduling in BW rather than in factory. Results are then written to a DSO as is normal for an HAP. Results are identical since the actual computation happens in APL.

          Does this answer your question?

          Br, Jan

          (0) 

Leave a Reply