Skip to Content
Technical Articles
Author's profile photo Denys van Kempen

Getting Started with SAP HANA Cloud | PAL and APL

 

With this blog series we provide an update with the latest information on getting started with SAP HANA Cloud on the SAP Cloud Platform.

  1. About SAP HANA Cloud
  2. SAP HANA Cloud Getting Started
  3. SAP HANA Cloud and SAP Business Application Studio
  4. HDI with SAP HANA Cloud
  5. SAP Analysis for Microsoft Office and SAP HANA Cloud
  6. Cloud Foundry Advanced
  7. SAP HANA Cloud and SAP BTP Trust
  8. Data masking and data anonymization
  9. Predictive Analysis Library (PAL) and Automated Predictive Library (APL) <=
  10. Remote data sources and virtual tables
  11. OData with SAP HANA Cloud
  12. SAP HANA Cloud Graph
  13. Role Attributes
  14. SAP HANA Cloud and Smart Data Integration

For more information about the free trial, see

For the new features overview posts, see

Questions? Post as comment.

Useful? Give us a like and share on social media.

Thanks!

/wp-content/uploads/2016/02/sapnwabline_885687.png

Using the Machine Learning Libraries in SAP HANA Cloud

Chief partner engineer, Philip MUGGLESTONE just updated his SAP HANA Cloud playlist on the SAP HANA Academy YouTube channel with a new video covering the machine learning libraries native to SAP HANA Cloud

  • PAL  – Predictive Analysis Library
  • APL – Automated Predictive Library

In this blog, you will find the video embedded with some additional information and resources.

You can watch the video tutorial in just under 12 minutes. What you get back is

  • Understand the prerequisites
  • Getting started with PAL
  • Getting started with APL

For those less familiar with the machine learning libraries: PAL is a native (built-in) application function library (AFL) for SAP HANA. APL bundles the algorithms of SAP Predictive Analytics which goes back to KXEN InfiniteInsight, acquired by SAP in 2013. Both AFLs can be used for linear regression and other common algorithms.

To continue your machine learning journey on SAP HANA Cloud, the following blog post is highly recommended:

Prerequisites

As with the SAP HANA platform edition (on-premises), we need to enable the script server process. Currently, this currently requires a service request on component HAN-CLS-HC (as documented). In addition, we need to create an SAP HANA Cloud instance with a minimum of 3 vCPUs. Scaling an existing SAP HANA Cloud instance up from 2 to 3 vCPUs currently also requires a service request and this can be combined.

The SAP HANA Cloud trial instance is fixed a 2 vCPUs and does not support AFLs (time of writing).

YouTube Playlist

For the complete list of tutorial videos for this playlist, see,

GitHub Code Repository

For the sample code repository, go to

Documentation

/wp-content/uploads/2016/02/sapnwabline_885687.png

Machine Learning – PAL & APL

In this tutorial, we get a brief overview about how to enable the application function libraries for SAP HANA cloud with a code walkthrough for both PAL and APL with references to the documentation.

[00:00] – Introduction and documentation

[00:30] – prerequisites: configure at least 3 vCPUs and enable script server

[01:45] – sample code ML_setup.sql

[02:00] – Setup preparations using Database Explorer

grant AFL__SYS_AFL_AFLPAL_EXECUTE to MYUSER;
grant "sap.pa.apl.base.roles::APL_EXECUTE" to MYUSER;

[04:15] – sample code ML_PAL.sql

[05:00] – create view, parameter tables, call a PAL function, working with results.

[07:00] – SAP HANA Cloud Predictive Analysis Library (PAL) reference guide

[07:20] – SAP HANA Academy – Predictive Analysis Library

[07:45] – APL Developer Guide

[08:00] – sample code ML_APL.sql

/wp-content/uploads/2016/02/sapnwabline_885687.png

Share and Connect 

Questions? Post as comment.

Useful? Give us a like and share on social media. Thanks!

If you would like to receive updates, connect with me on

For the author page of SAP Press, visit

For the SAP HANA Cloud e-bite, see

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Christoph Morgen
      Christoph Morgen

      Great intro Denis, note the ScriptServer can now be enabled with the Cloud Platform Cockpit UI.

      BR, Christoph

      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      Thanks, Christophe!

      For the reader,

      Self-service to enable the scriptserver service for PAL is available as of the QRC 03 release. As this requires 3 virtual CPUs, this is currently not available for the trial environment

      • https://blogs.sap.com/2020/10/07/whats-new-sap-hana-cloud-q3-2020/

       

      Author's profile photo Jorge Porca Grandal
      Jorge Porca Grandal

      Hi Denys,

       

      Is there any plan to provide scriptserver activation for hana cloud trial instances?, as you said it's necessary to execute pal, apl, flowgraphs...

      Thanks.

      Regards.

      Jorge Porca.

      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      Hi Jorge,

      I have not seen any information indicating that a 3 vPCU configuration for SAP HANA Cloud will be made avaiable anytime soon but these things can change of course.

      You can follow the SAP HANA Cloud tag (blogs and Q&A) for the latest updates. Should this be made avialable there will be announcements, for sure.

      Author's profile photo Jorge Porca Grandal
      Jorge Porca Grandal

      Thanks for your response Denis,

      Trial instances already have the option for 3 vCPU since Cristhmas aprox., so I hope that scriptserver option will be available soon.

      In the meanwhile I will follow your advice about the SAP HANA Cloud tag.

      Kind Regards.

      Jorge.

      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      2 vCPU; it is not even configurable

       

      Author's profile photo Jorge Porca Grandal
      Jorge Porca Grandal

      Hi Denys, you are right. I have checked with a new trial account.

      Thanks.

      Jorge.

       

       

      Author's profile photo Abhishek Chowdhury
      Abhishek Chowdhury

      Hi Denys,

      I am very new to SAP HANA cloud and following your other blog (Getting Started with SAP HANA Cloud | Video Tutorials | SAP Blogs) to get myself started. My intent is to learn predictive analytics and deduce insights from enterprise data. Here are some of my questions:-

      1. Looks like a script server is needed to run SAP predictive analytics which is not available in free trial account. Is this correct ?
      2. SAP DATA Intelligence also offers a free trial and I am wondering which one to use from a 'data science' perspective. My goal is to create a multivariable regression model which can be used to predict the dependent variables (based on independent variables)
      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      Hi Abhishek,

      Welcome

      1. correct
      2. HANA is a database with machine learning capabilities. Data Intelligence is a data management product targeted at the data engineer, data steward, data scientist, or data architect. This might be a better fit. Works with Jupyter Notebooks, Python, etc. The product originates in a Big Data add-on for HANA, Vora.
      Author's profile photo Abhishek Chowdhury
      Abhishek Chowdhury

      thanks Denys,

      I see there is free trial of data intelligence, are you aware of any validity of this free trial for data intelligence.

      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      30 days according to this article

      see also

      Author's profile photo Abhishek Chowdhury
      Abhishek Chowdhury

      thanks Denys,

      I see there are lot of tutorials on creating data intelligence workflows, I need to study more to find out what these workflows really do. I have been using Microsoft Azure - ML studio all this while and looking for a parallel in SAP.

      As a proof of concept for my company, i wish to:-

      1. Get the data set, in a csv format with sensor data on machine failures (25000 data points). Perform ETLs to cleanse the data.
      2. Would like to find correlations between independent variables.
      3. Would analyze the data further to determine if its a case of binary logistic regression or logistic regression.
      4. Train and then test the model. Lastly generate a webservice which would get me the dependent variables based on input independent variables.

      Is this something that can be achieved using the free version of Data Intelligence Trial. My lack of understanding is on 'Create workflow' (tutorials) part 1, 2 and 3 are all about creating/monitoring tasks and monitoring execution. Why do we need a workflow here ?

      I am trying to build a scenario to demonstrate machine learning capabilities in SAP and the confusion is :-

      1. Can I use PAL and APL libraries of SAP HANA Cloud to achieve the above scenario ? I understand it is not possible in trial version since script server is needed.
      2. Is this scenario achievable in the trial version of SAP Data intelligence.
      3. Then there is SAP Analytics as well. The last i checked was that model creation to train a dataset is not possible in the trial version.

      Your insights would be very useful to pick the right tool.