SAP HANA Automated Predictive Library Developer Guide
SAP HANA Automated Predictive Library Developer Guide
Content
SAP HANA Automated Predictive Library Developer Guide
What's New in This Release
Administrator and Developer Tasks
Getting Started as a Developer
SAP HANA APL: Basic Concepts
Model Types
Time Series Modeling
Functions
Parallelization
Parallel Apply
Segmented Modeling
Calling Functions
Choosing a Technique
Use Case: Training a Model
Use Case: Debriefing a Model with a Testing Partition
Function Availability
Architecture Overview
Compatibility Information
Working with SAP HANA APL Functions
Supported Database Objects
Supported SQL Data Types
Table Types
Table Type Variants
Calling a Function with the Direct Technique
Connecting to the Database Schema
Creating Table Types
Generating an AFL Wrapper
Creating Input and Output Tables
Calling the AFL Wrapper
Calling a Function with the Procedure Technique
Connecting to the Database Schema
Creating Input and Output Tables
Executing the Stored Procedure
Performance Considerations
Calling a Function as an ANY Procedure
Connecting to the Database Schema
Creating Input and Ouput Tables
Running the Function
Getting Progress Information
Canceling the Execution of a Function
Cancellable Functions
Analyzing Data with SAP HANA APL Functions
Creating the Model
Training the Model
Applying the Model
Partition Strategies
Interoperability between SAP HANA APL and Automated Analytics
Function Reference
Predictive Model Functions
APPLY_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
APL/ApplyExtraMode
Advanced Apply Settings
APL/ApplyExtraMode with Segmented Modeling
Example: DIRECT
Example: PROCEDURE
Example: Parallel Apply PROCEDURE
APPLY_MODEL_AND_TEST
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
APPLY_RECO_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
APPLY_RECOMMENDER_TO_BASKET
Input/Output Parameters
Input/Output Tables
OPERATION_CONFIG Parameters
Example
APPLY_RECOMMENDER_TO_USERS
Input/Output Parameters
Input/Output Tables
OPERATION_CONFIG Parameters
Example
APPLY_SOCIAL_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
COMPUTE_CONFUSION_MATRIX
Input/Output Tables
OPERATION_CONFIG Parameters
List of Returned Indicators
Example
CREATE_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
CREATE_MODEL_AND_TRAIN
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
CREATE_MODEL_AND_TRAIN (3 Datasets)
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
CREATE_MODEL_AND_TRAIN (with Debrief Tables)
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
CREATE_RECO_MODEL_AND_TRAIN
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
Using the Function to Obtain Recommendations for Similar Items
Example: DIRECT
Example: PROCEDURE
CREATE_RECOMMENDER
Input/Output Parameters
Input/Output Tables
OPERATION_CONFIG Parameters
Example
CREATE_SOCIAL_MODEL_AND_TRAIN
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
EXPORT_APPLY_CODE
Input/Output Tables
OPERATION_CONFIG Parameters
Supported Code Export Types
Example: DIRECT
Example: PROCEDURE
Example: PROCEDURE with Advanced Settings
EXPORT_APPLY_CODE_FOR_RECO
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
EXPORT_PROFITCURVES
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
EXPORT_VARIABLEDESCRIPTIONS
Input/Output Tables
Example
GET_MODEL_DATASET_TYPES
Input/Output Tables
Example: PROCEDURE
GET_MODEL_DEBRIEF
Input/Output Tables
OPERATION_CONFIG Parameters
Example: PROCEDURE
GET_MODEL_INFO
Input/Output Tables
Example: DIRECT
Example: DIRECT (with Multiple Datasets)
Example: PROCEDURE
Example: PROCEDURE (with Output Table Type)
GET_TABLE_TYPE_FOR_APPLY
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE with Advanced Settings
GET_TABLE_TYPE_FOR_SOCIAL_APPLY
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
GET_VARIABLE_INDICATORS
Input/Output Tables
Example: DIRECT
Example: PROCEDURE
IMPORT_MODEL
Input/Output Tables
Example: PROCEDURE
IMPORT_VARIABLEDESCRIPTIONS
Input/Output Tables
Example
PARALLEL_APPLY_MODEL
Input/Output Tables
Example
PARALLEL_APPLY_RECO_MODEL
Input/Output Tables
Example
PARALLEL_APPLY_SOCIAL_MODEL
Input/Output Tables
Example
PUBLISH_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
RETRAIN_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
RETRAIN_MODEL (3 Datasets)
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
TEST_MODEL
Input/Output Tables
Example: DIRECT
Example: PROCEDURE
TRAIN_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
TRAIN_MODEL (3 Datasets)
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
UPDATE_MODEL
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
Predictive Business Functions
DEBRIEF_APPLY_RESULT
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
FORECAST
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
FORECAST_AND_DEBRIEF
Input/Output Tables
OPERATION_CONFIG Parameters
Example: PROCEDURE
Example: Segmented Forecast PROCEDURE
GET_KEY_INFLUENCERS_FROM_MODEL
Input/Output Tables
Example: DIRECT
Example: PROCEDURE
KEY_INFLUENCERS
Input/Output Tables
Example
PROFILE_DATA
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
PROFILE_DATA_AND_GET_ASSOCIATIONRULES
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
RECOMMEND
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT
Example: PROCEDURE
SCORING_EQUATION
Input/Output Tables
OPERATION_CONFIG Parameters
Example: DIRECT Without PROFITCURVES OUT Table
Example: DIRECT with PROFITCURVES OUT Table
Example: PROCEDURE Without PROFITCURVES OUT Table
Example: PROCEDURE with PROFITCURVES OUT Table
Technical Functions
PING
PROGRESS_CLEANUP
Utility Stored Procedures
Common APL Aliases for Model Training
Table Type Reference
ADMIN
APPLY_OUT_TYPE
ASSOCIATION_RULES
CONTINUOUS_GROUPS
DATASET
DEBRIEF_METRIC
DEBRIEF_PROPERTY
FUNC_HEADER
INDICATORS
INFLUENCERS
INFO
LOG
MODEL
OPERATION_CONFIG
OTHER_GROUPS
OUTPUT_TABLE_TYPE
PROFITCURVES
PUBLISHING_SUMMARY
RESULT
RULE_ITEMS
SUMMARY
USER
VARIABLE_DESC
VARIABLE_ROLES
Table Types for Social Modeling
Social Models Serialization
ATTRIBUTES
GRAPH_FILTERS
GRAPH_INDICATORS
GRAPH_POST_PROCESSING
LINKS
NODES
RECO_SCORE
TRANSACTION
APPLY MODE for Social Modeling
Graph Types
Statistical Reports
Generic
List of Partitions
List of Variables
Category Frequencies of Variables and Partitions
Group Frequencies of Variables and Partitions
List of Continuous Variables
Target Types
Binary Target
Distribution of the Binary Target
ROC Curve of the BinaryTarget
Lift Curve of the BinaryTarget
Gain Curve of the BinaryTarget
Distribution of the Binary Target by Category
Distribution of the Binary Target by Group
Multiclass Target
Distribution of the Multiclass Target
Continuous Target
Continuous Target Statistics
Continuous Target Statistics by Category
Continuous Target Statistics by Group
Time Series Models
Model Overview
Model Components
Model Outliers
Model Performance by Horizon
Model Performance
Variables Ranked by Contribution to Trend
Cyclic Variable Analysis on the Detrended Signal
Model Change Points
Model Decomposition
Classification and Regression Models
List of Correlated Variable Pairs
Variables Ranked by Contribution to Explaining the Target
List of Excluded Variables
Binary Classification Confusion Matrix
Multinomial Classification Confusion Matrix
Model Performance
Runtimes
C++ Runtime
Java Runtime
JavaScript Runtime
Load the JavaScript Runtime
Using the JavaScript Runtime
Create a Predictive Engine
Retrieve Model Information
Get the Model Influencers
Get a Prediction
Sample Use Case: Predicting Auto Insurance Fraud
The Business Data
Overall Workflow
The Learning Phase
Training Inputs
Training Outputs
The Prediction Phase
Apply Inputs
Apply Outputs
Troubleshooting
Check if SAP HANA APL is Correctly Loaded
Script Error During Stored Procedure Creation
Error During Stored Procedure Execution