You can enable a partner extension with R script and publish it to the SAP Analytics
Extensions Directory, where you can also consume R Extensions written by others.
The following are the system requirements and configuration process to create and export
an R Extension.
Prerequisites:
-
Server: SAP HANA system (SPS 9+) with PAL, APL and R
configured.
-
Client: Predictive Analytics 2.5+ installed and R configured.
Configuration Process:
To create or edit an R Extension, take the following
steps:
- Load a dataset to Expert Analytics.
- Go to the Predict room.
- Below the Components List on the right-hand side of the window, click the + icon to reveal
the context menu. From the menu, select R
Extension to launch the editor to create a custom R
Extension.
- The Create New R Extension dialog box opens at the General tabbed
page. Configure the following settings:
- Add an Extension Name.
- Add an Extension Type. Choose Data
Writer (for agnostic only) and Data
Prepare (for SAP HANA and agnostic).
- If you chose Algorithms as the Extensions Type, select an algorithm
Category to which the extension is added.
Choose from the following predefined categories:
Association,
Classification,
Clustering, R
Extensions, Decision Trees,
Neural Networks,
Outliers, Regression
and Time Series. In Expert Analytics version 2.5,
for the Data Writer and Data Prepare extension types, the Category field
is disabled and the only option is R
Extensions.
- Optionally, enter a description to the text box, Extension
Description.
- To enable recipients to edit, select the checkbox, Make
editable when shared.
- Click Next.
- In the Script tabbed page, choose from the following options:
- Add/Write R script to the Script Editor.
- Set the input parameters as necessary. They include Primary Function
Name, Input DataFrame,
Output DataFrame and Model
Variable Name.
- Select the checkboxes as necessary. They include Show the
Visualization, Show Summary and
Option to save the model.
- Click Next.
- In the Settings tabbed page, configure the output parameters to appear in the configuration
panel at a future time when the extension is consumed in a chain. Select from
the following options:
- In the Output Table Definitions, select one of the following checkboxes:
Consider all columns from previous component
or Consider none. The component
generates one predicted column and your selection will affect the
Results Tab. For example, suppose the previous component contains five
columns. If you consider all columns from the previous component, the
Results tab will display the five previous component columns plus the
newly-generated predicted column. In this example, that means six
columns. If you consider no columns from the previous component, the
results tab will display only the newly generated column.
- Choose a Data Type for each output column
name.
- Enter a New Predicted Column Name for each
output column name.
- Configure the input parameters to appear in the configuration panel at a future time when
the extension is consumed in a chain. In Property View
Definitions, select from the following options:
- Function Parameters: The parameters of the primary function or the
model score function.
- Property Display Name: Optionally, enter a property display name
for any function a parameter to appear in the configuration window. Use
to help users make a more intuitive selection.
- Control Type: Enables you to decide how you want users to input
this parameter. The input methods include text box, dropdown box, combo
box, single column selector and multiple column selector.
- Settings icon
: Use to set a
mandatory field and choose the default input data type from the
following list: String,
Integer, Double and
R-Literal.
- Click Finish. The R Extension is encrypted and saved on the local
file system. The component list in Expert Analytics is updated
with the new R Extension name under the appropriate category.
- The updated R Extension appears in the Component List under the appropriate section. (For
example, if you create Data Writers, it appears in the Data Writers section.)
Take any or all of the following actions:
- Identify the R Extension in the menu via the EXT identifier.
- View the R Extension description by clicking the extension name.
- Export to a .spar file for sharing.
- Save the file via File Explorer.
- Share it via the Portal at this address:
http://www.sap.com/bi-partner-extensions.
- Edit in the R Extension editor window. Option, available only to
the author.
- Delete. This option cannot be undone. The associated files are
deleted from the system immediately.
You have enabled partner extensions with R script and seen how easily -- and securely --
extensions can be shared with partners.