Prediction models are trending globally and are now more widely used than ever before. If you’re looking to take advantage of this technology to better understand your data, don’t worry, our experts are right here to support you, whether you are an existing SAP HANA customer or you are planning to move to SAP HANA soon.
We can develop advanced analytic layers, and thanks to the integrated predictive libraries we are also capable of producing complex machine learning solutions according to your needs. Also, if you have an Enterprise Resource Planning (ERP) system, we can connect to your existing system to extract data from it, take advantage of in-memory capabilities, and help you discover new insights.
1. Introduction to SAP HANA Automated Predictive Library
Some of the most popular scenarios for predictive models include fraud detection, product quality assessment, medical diagnosis, marketing campaign planning, and a whole range of others, depending on the industry.
Whatever sector you’re operating in, we’ll show you how you can get started with predictive models with your existing SAP HANA database. SAP provides the APL (Automated Predictive Library) package within your SAP HANA. Using this library, we can build a time travel machine and predict future results based on historical data.
The APL included with SAP HANA enables you to build these solutions quickly and effectively, with minimum effort and significant flexibility on user parameters. All that’s needed is to train the model with existing data and apply it to new entries.
2. Use case: do I get revenue from visitors to my landing page?
In this example, we’ll look at a fairly simple question. This company wants to know whether a certain behavior (visiting a page on their website) correlates with a certain action (purchasing from the website).
The dataset used consists of fields such as the different types of pages visited by the visitor in that session and the total time spent in each of these page categories, plus some additional metrics measured by "Google Analytics" for each page in the e-commerce site.
Also, time dimensions such as which month it is, whether it is a weekend or not, and how close the visit is to a specific special day (e.g., Christmas, Thanksgiving, Valentine's Day), along with location information, are all considered.
The following use case leads us to a conclusion for each type of behavior - whether it brings in revenue or not - expressed as “TRUE” or “FALSE” in the first table below. The system can then predict the results of future visits, based on observed behaviors as reported in the historical data, which gives us the predictions in the second table below.
Training Dataset:
New entries with APL predicted results:
3. Use case: products recommendations
Another example we can use is the recommendation model. The training dataset consists of purchased items, quantities, and dates by different customers of a retail store. The APL recommendation algorithm checks the set of previous purchases, as well as the specific customer’s purchases, and recommends other items for each customer.
As it is a flexible algorithm, we can change certain parameters, such as promoting bestselling or slow-selling items, considering the relationship between items (i.e. customers often buy trousers and shirts in the same purchase), or by including or excluding already purchased items.
Training Dataset:
Following the calculation (with all predefined parameters and metrics) the following top 5 items are recommended for our example customer (“25680”), determining the number of recommendations is also possible.
Instead of putting a lot of time and effort into writing large amounts of code, with APL, this outcome is possible by running just a few lines of code (with prepared parameter tables) once only. Training the model with your dataset and applying it to new entries takes less than a minute.
4. Conclusions
In this blog article two use cases were implemented to showcase the machine learning capabilities that SAP HANA Database offers.
Although there are a lot of different solutions out in the market offering machine learning capabilities, they usually imply the integration of more than two pieces of software and the movement of data.
SAP HANA, with its built-in machine learning capabilities, allows end-users to leverage artificial intelligence capabilities without moving data and without integrating different pieces of software – everything is already there for you.
To find out more about harnessing the power of APL and the SAP HANA Database to create and use predictive models in your organisation, get in touch with one of our experts.