You are on page 1of 12

What is Application Function Library (AFL)?

Within SAP HANA, functions for a particular functional area are


grouped into an Application Function Library (AFL).

1
Pre-delivered commonly utilized business, predictive and other types of algorithms for
use in projects or solutions that run on SAP HANA.
These algorithms can be leveraged directly in development projects, speeding up
projects by avoiding writing custom complex algorithms from scratch.
Written in C++

Primary libraries included in AFL


Predictive Analysis Libraries (PAL) is a set of functions in AFL. It contains pre-build,
parameter-driven, commonly used algorithms primarily related to predictive analysis
and data mining.
Business Function Library (BFL) is a set of functions in AFL. It contains pre-build,
parameter-driven, commonly used algorithms primarily related to finance.

2
3
Benefits of AFL:

These algorithms can be leveraged directly in development


projects, speeding up projects by avoiding writing custom complex
algorithms from scratch.
AFL operations also offer very fast performance, as AFL functions
run in the core of SAP HANA in-memory DB.

4
Increasing performance is the main goal:
We can dramatically increase performance by executing complex computations in the
database instead of at the application sever level. SAP HANA provides several techniques to
move application logic into the database, and one of the most important is the use of
application functions.
Application functions are like database procedures written in C++ and called from outside to
perform data intensive and complex operations.

Currently, PAL and BFL are delivered in one archive (that is, one SAR file with the name
AFL.SAR). The AFL archive is not part of the HANA appliance, and must be installed separately
by the administrator.

5
What is Predictive Analysis Library (PAL)?

The Predictive Analysis Library (PAL) is a built-in C++ library to


perform advanced analytic algorithms.

6
PAL is available on every HANA license option as well as HANA Cloud

Platform.

PAL defines functions that can be called from within SQLScript procedures.

PAL is embedded in SAP HANA via the Application Function Library.

PAL includes classic and universal predictive analysis algorithms in data-

mining and machine learning areas.

7
Why do we need PAL?

Many of the standard algorithms used in data mining and predictive analysis would
be too difficult or even impossible to implement yourself in SQLScript.
On the other hand, if you want to perform real-time predictive analysis, you need
to avoid exporting your data to an external application server to run the predictive
analysis function. That's where PAL comes in.
The idea behind PAL is to make it very straightforward to execute. For example, a
clustering calculation (like K-means) on your data can be implemented in SAP
HANA with just a few lines of SQLScript.
In most cases, the steps to use PAL are

8
Algorithms supported by PAL:

The algorithms in PAL are carefully selected based on the following criteria:

o Needed for SAP applications and customers.

o Most commonly used based on market surveys.

o Generally available in other database products.

o Customized algorithms to support real & complex business scenarios.

Currently PAL includes following predictive analysis algorithms:

9
10
11
Associations When this happens, what else happens

Classifications People like this, usually do this

Cluster These customers exhibit similar buying behavior

Regression Customers with income X and children Y usually spend Z

Time Series In the last few years sales are falling but at this time of year we still
expect to sell X amount

Outlier Detection These sports fans are not behaving like the rest of their group

Weighted Scoring vendors who delivery late get a big penalty and a lesser penalty
for wrong pricing

12

You might also like