You can export an entire chain of trained models as a stored procedure from Expert
Analytics to SAP HANA, where the chain can be consumed directly as a procedure or
view.
System Requirements: - Server: SAP HANA Studio system (SPS 10+) with Predictive Analytics Library
(PAL), Automated Predictive Library (APL) 3.0.10 and R configured.
- Client:SAP Predictive Analytics 3.0 installed.
- Create and execute a chain of models in Predict room. In the chain
you can use different types of components, including PAL, APL, and R
Extensions.
- To export the chain as a stored procedure to SAP HANA, click a Model
Statistics or Model Compare component on
the chain. Next, from its context menu, select Export Model
Chain.
- In the resulting dialog box, enter the details required to generate metadata for the
exported chain. Add Schema, Procedure, View, and Model Chain names. Optionally,
add a model chain description.
- If you want to overwrite an existing chain, select the checkbox, Overwrite, if
exists. When the checkbox is selected, the new chain will
replace any current version in Expert Analytics and SAP
HANA.
- Click Export.
The entire chain of trained models is exported to SAP HANA. Here you can work
with the model chain in a single stored procedure or view.
Example
Work with Model Chain as an SAP HANA Stored Procedure
To run the model chain against a specified data set, call the stored procedure with the data
set specified. After which, the results display in the SAP HANA User
Interface (UI).
The following are sample calls:
call "myschema"."mymodel"("someSchema"."someTable", [?])
call "myschema"."mymodel"("someSchema"."someTable", “someSchema”.”someOutputTable”)
Work with Model Chain in the SAP HANA Result View
To run the model chain against a data set trained in
Expert Analytics, select
from the Result View. The following is a sample SELECT statement:
SELECT * FROM "myschema"."my_model_result_view"