Académique Documents
Professionnel Documents
Culture Documents
RDP267
Hands-on Exercises
SAP TechEd 2013
Getting started with your session
Login credentials and group numbers can be found in the My Reservation tab on the SAP TechEd Virtual
Hands-On Workshops website (https://saptechedhandson.sap.com/).
Important: Some of the sessions use place holders for users (e.g. CD300_XX) or objects (e.g.
ZCD400_Exercise_##). The place holders XX or ## must be replaced with your assigned group number,
which you find in the My Reservation tab on the above mentioned website.
2
INITIAL SETUP ................................................................................................................................................. 4
CHAPTER 1 .................................................................................................................................................... 10
Use HANA Studio and SQL Script to create a PAL procedure for C4.5 algorithm ................................. 11
Use HANA Studio and SQL Script to run the trained C4.5 Model ............................................................ 27
Use HANA Studio and AFM to create a PAL procedure for C4.5 algorithm ............................................ 36
CHAPTER 2 .................................................................................................................................................... 55
Use HANA Studio and SQL Script to create a PAL procedure for Outlier algorithm ............................. 56
Use HANA Studio and AFM to create a PAL procedure for Outlier algorithm ........................................ 65
CHAPTER 3 .................................................................................................................................................... 76
Use R Studio to develop a Generalized Linear Model ............................................................................... 77
4
INITIAL SETUP
During the exercises, you will work on a SAP HANA system with the following system properties:
Host name:
coe-he-084.wdf.sap.corp
Instance number:
10
SAP System ID (SID):
M31
Database user name:
RDP267_# (# = your assigned student ID, maybe 1 or 2 digits)
Password:
Initial1
Database Schema
RDP267
Student exercise package RDP267.sessionX.# (X = your assigned session number, # = student ID)
Solution package
RDP267.solution
As preparatory steps, make sure a connection to the backend SAP HANA database system is defined with
your assigned user (RDP267_#).
Explanation
1.
Screenshot
Explanation
Then open
General -> Security
-> Secure Storage
Screenshot
Explanation
Screenshot
Explanation
3. Connect to the HANA System.
Screenshot
Explanation
Screenshot
Host Name:
Instance Number: 10
coe-he-084.wdf.sap.corp
Password: Initial1
Explanation
5. Explore the SAP HANA Database Catalog and
Repository Content structure for the Workshop
The Database Catalog, i.e. the SAP HANA
database schema with the tables for this
workshop is the schema RDP267.
To explore the schema:
Expand the Catalog folder > RDP267 >
Tables
Screenshot
10
CHAPTER 1
In this chapter we will perform Hands-on Exercises in HANA Studio using the HANA PAL library
Estimated time: 45 minutes
Objective
Use both SQL Script and the new Application Function Modeler (AFM) within HANA Studio to create
and execute PAL procedures.
What you will learn
Exercise description
Use HANA Studio and SQL Script to create a PAL procedure for C4.5 algorithm
Use HANA Studio and SQL Script to run the trained C4.5 Model
Use HANA Studio and AFM to create a PAL procedure for C4.5 algorithm
11
Use HANA Studio and SQL Script to create a PAL procedure for C4.5 algorithm
Explanation
Screenshot
2. Click the
icon.
12
Explanation
Screenshot
13
Explanation
5. Click the
icon to launch
another SQL Console window
(separate tab).
Screenshot
14
Explanation
Screenshot
15
Explanation
Screenshot
16
Explanation
Screenshot
17
Explanation
Screenshot
18
Explanation
Screenshot
19
Explanation
Screenshot
20
Explanation
Screenshot
21
Explanation
Screenshot
22
Explanation
Screenshot
23
Explanation
Screenshot
24
Explanation
Screenshot
25
Explanation
Screenshot
tab to select
26
Explanation
Screenshot
27
Use HANA Studio and SQL Script to run the trained C4.5 Model
Explanation
2. Click the
icon, to open an
SQL Console again.
Screenshot
28
Explanation
Screenshot
29
Explanation
Screenshot
30
Explanation
Screenshot
31
Explanation
Screenshot
32
Explanation
Screenshot
33
Explanation
Screenshot
34
Explanation
Screenshot
35
Explanation
Screenshot
36
Use HANA Studio and AFM to create a PAL procedure for C4.5 algorithm
Explanation
Screenshot
tab to
3. Click the
Project...
menu item to execute it.
You can also press r.
37
Explanation
4. Click Project
5. Click Next
Screenshot
..
38
Explanation
Screenshot
7. Click Next
You can also press Alt+n.
39
Explanation
Screenshot
9. Click the
Window
menu item.
40
Explanation
Screenshot
14.
41
Explanation
Screenshot
42
Explanation
Screenshot
43
Explanation
Screenshot
44
Explanation
Screenshot
45
Explanation
25. Click OK
Screenshot
46
Explanation
Screenshot
47
Explanation
Screenshot
48
Explanation
Screenshot
Select
. and drag and
drop to the main design panel
icon.
49
Explanation
Screenshot
50
Explanation
Screenshot
button
51
Explanation
Screenshot
52
Explanation
Screenshot
object.
49. Click on
MY_AFM_CDT.aflmodel
with the right
mouse button.
53
Explanation
Screenshot
51. Click
RDP267.PROJ_RDP267_99::MY_A
FM_CDT.model
.
52. Click OK
at top
object.
54
Explanation
Screenshot
Chapter Summary:
In this chapter you learned via HANDS ON exercises how to create and execute PAL Algorithms via both
SQL Script and via AFM.
55
CHAPTER 2
In this chapter we will perform Hands-on Exercises using the HANA R integration.
Estimated time: 30 mins
Objective
Use both SQL Script and the new Application Function Modeler (AFM) within HANA Studio to create and
execute PAL procedures.
What you will learn
Exercise description
Use HANA Studio and SQL Script to create a PAL procedure for Outlier algorithm
Use HANA Studio and AFM to create a PAL procedure for Outlier algorithm
56
Use HANA Studio and SQL Script to create a PAL procedure for Outlier algorithm
Explanation
Screenshot
57
Explanation
Screenshot
58
Explanation
Screenshot
59
Explanation
Screenshot
60
Explanation
Screenshot
61
Explanation
Screenshot
62
Explanation
Screenshot
63
Explanation
Screenshot
64
Explanation
Screenshot
65
Use HANA Studio and AFM to create a PAL procedure for Outlier algorithm
Explanation
Screenshot
tab to
66
Explanation
Screenshot
6. Click Next
67
Explanation
Screenshot
8. Click Finish
You can also press Alt+f.
9. Double-click on
MY_AFM_AD.aflpmml
.
10. Click .
Open the Clustering group of PAL
Algorithms by clicking on the arrow
next to the arrow icon for Clustering.
.
68
Explanation
Screenshot
ANOMALIES icon
drop it on the Data icon.
and
69
Explanation
Screenshot
70
Explanation
Screenshot
71
Explanation
icon.
by clicking it.
Screenshot
72
Explanation
Screenshot
73
Explanation
Screenshot
tab to select
74
Explanation
Screenshot
at top
75
Explanation
Screenshot
Chapter Summary
In this chapter you learned via HANDS ON exercises how to create and execute PAL Algorithms via both
SQL Script and via AFM
76
CHAPTER 3
In this chapter we will perform Hands-on Exercises to run our trained predictive models
Estimated time: 20 minutes
Objective
The objective of this chapter is give you an understanding of the fundamentals of the HANA/R connectivity
through a real-life example and application of a widely used statistical method.
What you will learn
Exercise description
77
1. Click Start
Screenshot
menu item to
78
Explanation
Screenshot
4.
Enter the share location in the top field of
the Open File dialog.
D:\Files\Session\RDP267 and hit the green
arrow button next to that.
79
Explanation
Screenshot
80
Explanation
Screenshot
81
Explanation
Screenshot
82
Explanation
Screenshot
83
Explanation
Screenshot
84
Explanation
Screenshot
85
Explanation
Generalized Linear Models can be
viewed as an extension to
Regression Models in that they allow
2 fundamental additions:
Screenshot
86
Explanation
22.
For the generation of predictions, the
function "predict" is used, indicating with
which model the values are to be
created.
In the window showing the script, select
the region depicted here (just that one
line) and click "Run".
Screenshot
87
Explanation
26. Click
Screenshot
88
Explanation
Screenshot
89
Explanation
Screenshot
menu item
90
Explanation
Screenshot
91
Explanation
Screenshot
92
Explanation
Screenshot
Chapter Summary:
In this chapter you learned the fundamentals of the HANA/R connectivity through a real-life HANDS-ON
example and application of Generalized Linear Models, a widely used statistical method.
Thank you for participating in this SAP TechEd Virtual Hands-On Workshop!
Please, take a few minutes to answer a couple of feedback questions concerning your session.
Find a shortcut to the survey on the desktop of your virtual laptop image or visit
https://www.sapsurvey.com/cgi-bin/qwebcorporate.dll?idx=FSQCZ7
93
94