SAP HANA PAL - K-Means Algorithm or How To Do Cust... - SAP Community-M

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

3/14/24, 7:02 AM SAP HANA PAL – K-Means Algorithm or How to do Cust...

- SAP Community

m
Products and Technology Groups Partners Topics Events What's New Get Started Explor
u
ni
SAP Community  Products and Technology  Technology  Technology Blogs by Members  SAP HANA PAL – K-Means Algorithm or How to do Cust...
t
Technology
y Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the
mix!

All community  What are you looking for today?

SAP HANA PAL – K-Means Algorithm or How to do Customer Segmentation for the
Telecommunications Industry

Former Member


‎03-28-2013 3:11 PM

 5 Kudos

PAL is an optional component from SAP HANA and its main porpoise is to enable modelers to perform predictive analysis
over big volumes of data. If this is the first time you hear about PAL, I would recommend reading the official documentation.
You can also take a look at my prior post where I talk about the Apriori Algorithm.

https://community.sap.com/t5/technology-blogs-by-members/sap-hana-pal-k-means-algorithm-or-how -to-do-customer-segmentation-for-the/ba-p/12976696/page/2 1/39


3/14/24, 7:02 AM SAP HANA PAL – K-Means Algorithm or How to do Cust... - SAP Community

Generate the PAL procedure

Now that I have my dataset, I’m ready to start coding. The first thing we need to do is generate the PAL procedure by
calling the AFL Wrapper Generator. To do so we need to create a number of Table Types that will be used to define the
structure of the data that will be used as input and output parameters:

SET SCHEMA _SYS_AFL;

/* Table Type that will be used as the output parameter

that will contain which cluster has been assigned to each

customer and what is the distance to the mean of the cluster */

DROP TYPE PAL_KMEANS_RESASSIGN_TELCO;

CREATE TYPE PAL_KMEANS_RESASSIGN_TELCO AS TABLE(

"ID" INT,

"CENTER_ASSIGN" INT,

"DISTANCE" DOUBLE

);

https://community.sap.com/t5/technology-blogs-by-members/sap-hana-pal-k-means-algorithm-or-how -to-do-customer-segmentation-for-the/ba-p/12976696/page/2 6/39

You might also like