cancel
Showing results for 
Search instead for 
Did you mean: 

APL interface for Models

i033659
Advisor
Advisor
0 Kudos

Hello,

I created a (time-series) model with Predictive Analytics / Automated Analytics. I published this model into HANA, where I get the table for the model with essentially a lot of parameters and an entry in KxAdmin.

Now I want to use that model with APL within HANA, more precisely with APPLY_MODEL. How to do that? I do not quite see the connection between the MODEL input table for APPLY_MODEL and the model table created by automated analytics, in order to create the corresponding procedure.

Thanks,

Ingo

Accepted Solutions (1)

Accepted Solutions (1)

marc_daniau
Advisor
Advisor
0 Kudos

a) Make sure you use the native type in the Apply signature

insert into CALL_SIGNATURE values (2, 'USER_APL', 'MODEL_NATIVE_T',    'IN');

b) Specify where the model is and its name

create view MODEL_SORTED AS

SELECT * 

from <table_where_you_saved_the_model>

where NAME = '<the_model_name>' and VERSION = 1 order by "ID" asc  ;


c) The Apply call must look like this

call APLWRAPPER_APPLY_MODEL(FUNC_HEADER, MODEL_SORTED, APPLY_CONFIG, <the_input_table>, APPLY_OUT , APPLY_LOG) with overview;

i033659
Advisor
Advisor
0 Kudos

Hi Marc,

What is the the type of model_native_t?

Thanks,

Ingo

marc_daniau
Advisor
Advisor
0 Kudos

The APL table type "model_native_t" is created with the script apl_create_table_types.sql that comes with the installer under ...\samples\sql\direct

It describes the structure corresponding to the table that gets created when saving a model from the Automated Analytics Desktop client to the SAP HANA database.

Answers (1)

Answers (1)

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ingo,

Kindly mark the question as Answered if such is the case.

Best regards

Antoine