Skip to Content


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.

29 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) 
  3. jay_kay70 Jaya

    Hi Antonie,

    Hope you are doing good. By any means can I get the data set for the same. My ID is jothikumar dot rj at gmail dot com.

    Anxious to simulate the same from my end. Hoping to hear from you.

     

    Cheers,

    JK.

    (0) 
  4. Antoine CHABERT Post author

    Please send me an email and I’ll share the dataset with you. Please see my email address on my profile. Thanks & regards Antoine

     

    (0) 
  5. Lance Nurick

    Hi Antoine,

     

    Please could load the dataset to github or similar and post the link.

    My question relates to the structure of the dataset. You note that the source dataset is aggregated by month and the forecast will be 12 monthly periods into the future. However, in the screenshot you are clearly using a Date type field as the time component. Does this mean you are using some arbitrary date in each month for example first or last day of each month to represent the month. If yes, then I assume you are doing this because of a current limitation in Predictive Factory. From my trials and errors using this tool I found that in Predictive Analytics Automated Modeler I can build a time series using a sequential Integer as the time component, for example a number to represent the month numbers. However, this model cannot be imported into Predictive Factory because in PF only a date field is recognised as the time component. Is this correct? I would love to see your dataset to simulate in my environment.

     

    cheers,

    Lance

    (0) 
  6. Lance Nurick

    I also think it’s worth noting that at this stage it seems that HANA Information Views (i.e. calculation views) are not supported for segmenting models in predictive Factory:

     

    (0) 
    1. Antoine CHABERT Post author

      What is the version that you use? Can you please raise a support ticket on the same? I would like to investigate this. Kind regards Antoine

      (0) 
    2. Antoine CHABERT Post author

       

      Hi Lance,

      After discussing this in-house, I have some news to share with you.

      The problem exists in SAP PA 3.1 and has been resolved in SAP PA 3.2.

      In 3.1 you have a workaround which consists in using a SAP HANA server instead of a Automated Modeling Server. Please give it a try.

      Kind regards & thanks for raising this to my attention.

      Antoine

       

      (0) 
      1. Lance Nurick

        hi Antoine,

        Thanks for your responses. I just wanted to add some more details to your proposed workaround above for the benefit of others. I have tested and confirmed that I am able to use a Calculation View as a dataset for a segmented model when I use a HANA server as the modelling server for the input dataset. However, it’s worth pointing out that you need to use an Automated Modelling server in your project first in order to create the model (or import the model) in Predictive Factory. So, in your project it is necessary to have both an Automated Modelling Server and a HANA Server. the process is then as follows:

        1. create calc view in HANA and set a variable on the dimension that you want to segment your time series model on (i used a single entry optional variable)
        2. create model using calc view as input dataset through data connection of an Automated modelling server.
        3. set a value for the variable (predictive factory provides an interface to fill the variable)
        4. do not segment this model
        5. save and train
        6. once a successful version is created you can select this version and click “segment”
        7. now select the same calc view however connect through the HANA server, not the Automated Modelling server
        8. set the variable to “No Filter”
        9. segment by the dimension upon which the variable is created

        this worked for me. It obviously adds a step to the process but the end result is still a time saver over having to created each variation individually.

         

        One question regarding segmentation – is there any plan to allow for segmenting models by multiple dimensions? currently it is only possible with one dimension. So in our case we want to generate a forecast by Product Category and Customer Segment. So I am having to create multiple models for each product category and within each model I am segmenting by Customer Segment. It would be fantastic if I only had to create one model for the forecast and then the system could automatically create the possible combinations of Product Category and Customer Segment.

         

        cheers,

         

        Lance

        (1) 
        1. Antoine CHABERT Post author

          Hi Lance, thanks for the great interaction! As I mention above, We fixed this problem in 3.2 planned to be released next Monday. So please give it a try and you will just need to set up an Automated modeling server connected to Hana via the ODBC connection. On your idea of segmenting over multiple fields, you are spot on on the requirement and this is something I often hear. Would you be so kind to raise an idea in our Idea Place for predictive? Then we can evaluate the overall traction on this one and act accordingly. Again thanks for the feedback. Cheers Antoine

          (0) 
  7. Antoine CHABERT Post author

    By version, I mean I please need

    1 the one of the Factory

    2 the one of the Desktop

    3 the one of the Server

    What does your view contain?

    kind regards

    Antoine

    (0) 

Leave a Reply