Having recently installed the the new Automated Predictive Library (APL), the former KXEN Infinite Insight Libraries inside HANA, I wanted to share my experience.

 

The benefit the APL brings is that we can now utilise the KXEN libraries directly in-memory within the HANA Platform so the data never needs to leave HANA.  These libraries are a core part of Predictive Analytics 2.0 and are found in both the Automated and Expert perspectives within this.  As the name suggests when using the APL we have attempted to automate as much of the predictive process as possible. To learn more about Predictive Analytics 2.0 have a look here Introducing SAP Predictive Analytics 2.0!

 

With the Predictive Analytics 2.0 release we have actually released version 1.1 of the APL, (version 1.0 was an internal only release).

 

With the APL 1.1  the following predictive functions have been included.

  • Classification
  • Regression
  • Clustering
  • Time Series
  • Key Influencers

 

For a deeper explanation of the APL please have a look at this great blog from Ashish

What is the SAP Automated Predictive Library (APL) for SAP HANA?

For the official release information please see the SAP Note below

http://service.sap.com/sap/support/notes/2111573

 

The APL is actually contained within Predictive Analytics 2.0 download, so first you will need to download that component first.

 

APL Download v2.png

The official APL documentation can be found at http://help.sap.com/pa

APL Help.png

 

 

The pre-requisits for the APL are

1. SAP HANA SP 9 or above – I used HANA revision 92

2. unixODBC – I downloaded and compiled from the source here.  I won’t repeat the instructions as they are very clear at http://www.unixodbc.org/

3. AFL SDK  1.00.090 – I don’t believe you need to install this as it already comes with HANA

unixODBC.png

Once unixODBC is installed you should find it in /usr/local/lib as shown below

 

usr local lib.png

 

As shown in the APL documentation on page7, you need to create a symbolic link for libodbc.so.1 such as

 

  ln –s libodbc.so.2 libodbc.so.1

 

Now you need to add the /usr/local/lib to the LD_LIBRARY_PATH.

 

LD_LIBRARY_PATH=$LD_LIBRARY_PATH=:/usr/local/lib

 

These changes should be added to the customer.sh located in the home directory of the hana adm user.  This file won’t exist unless you have already made some changes to your environment.

/wp-content/uploads/2015/02/hdbenv_648975.png

 

LD_LIB.png

 

The APL install itself is very easy, just upload and extract the TGZ file and then launch hdbinst as root.  The file I uploaded was from the full PA 2.0 download and called “SAPPAAPL2000_0.TGZ”

 

mo-dad69e91a:/tmp/apl-1.1.0.20-linux_x64/installer # ls -l

total 28

-rwxr-xr-x 1 30003 shadow 19128 Nov 20 22:01 hdbinst

drwxr-xr-x 5 root  root    4096 Feb 12 13:57 instruntime

drwxr-xr-x 2 root  root    4096 Feb 12 13:57 packages

mo-dad69e91a:/tmp/apl-1.1.0.20-linux_x64/installer # ./hdbinst

 

Enter your SYSTEM ID and credentials and the APL will be installed, HANA will be restarted to allow the install to complete.

That is the software installed you now need to configure it by running the supplied SQL scripts.

 

If you navigate to the extracted TGZ location you should see samples/sql and in here you can open the apl_admin.sql as shown/wp-content/uploads/2015/02/apl_admin_648992.png

 

In here there is some “sample” SQL code to use 🙂

 

You need to enable the HANA ScriptServer if it is not already running within your environment – either directly via SQL or in HANA Studio at Admin Console, Configuration, daemon.ini

 

alter system alter configuration (‘daemon.ini’, ‘SYSTEM’) set (‘scriptserver’, ‘instances’) = ‘1’ with reconfigure;

 

With that running you should now be able to check the APL is installed correctly, all of the APL function statements should return APL related rows such as shown below

 

Screen Shot 2015-02-19 at 15.38.50.png

 

Screen Shot 2015-02-19 at 15.38.58.png

Screen Shot 2015-02-19 at 15.39.04.png

Screen Shot 2015-02-19 at 15.39.27.png

 

As you can see the APL is now installed, now you may want to install and configure the APL and the samples provided, which can be found here –

Using the APL samples provided with Predictive Analysis 2.0

 

If you are updating your HANA install then you should look how to uninstall the APL here How to uninstall the Automated Predictive Library in SAP HANA

To report this post you need to login first.

3 Comments

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

  1. hariz houssem

    Thanks for the tutorial.

    You said “The APL install itself is very easy, just upload and extract the TGZ file and then launch hdbinst as root.  The file I uploaded was from the full PA 2.0 download and called “SAPPAAPL2000_0.TGZ””. Do you mean download or upload ? and where should I upload it ?

    (0) 
  2. Ian Henry Post author

    Hi Jason,

    The steps for installing the different versions of the APL are very similar.  The main changes with the newer APL 3.x, are the breadth of algorithms and we have simplified how these are accessed.

    (0) 

Leave a Reply