Scripting Mechanics

Once you've connected the required scripting node to the data flow, you'll need to add the script; you can download a script via the Pyramid Marketplace, select a shared script, or write a script. You then need to configure the script by selecting a virtual scripting environment, defining input and output columns, and more.

Configuring the Scripting Node

To add a script to the data flow, connect the relevant scripting node to the table containing the columns you want to input into the script. Configure the script from the node's Properties panel.

The Scripting nodes that you can add to your Data Flow are:

  • Scripting Model: Machine learning models that have been built using a Learn & Predict script, then saved, can be used as a target using the Scripting Model node.
  • Market: Download a Python or R script from the Marketplace catalog.
  • Python: Download a Python script, inject a shared Python script, write a Python script, or generate a Python script using the Generate Your Script feature.
  • R: Download an R script, inject a shared R script, write an R script, or generate an R script using the Generate Your Script feature.

Tip: For Python and R Scripting nodes, you can generate a new script using the Generate Your Script feature. In this case, you need to add your node, make your selections in the Properties panel, and click the Gen AI button (yellow arrow below). For more information, see Generate Your Script.

Properties panel

Select the Scripting node (listed above) on the canvas, to view and edit its details in the Properties panel. The following shows the Properties panel where a Python node is selected on the canvas:

Script Panel

Script Type

For Python and R nodes, you can select Regular Script or Learn & Predict Script (yellow box above). Learn and predict scripts are trained on a given data set, and can then be used to make predictions.

  • Click here to learn about learn and predict scripts.

Download a Script

Click the shopping cart icon (green arrow above) to open the Pyramid Marketplace and download a script from the available catalog. Your downloaded Script is written to the Script panel.

  • Click here to learn more about the Marketplace.

Inject a Shared Script

Scripts can be constructed in the Formulate module and shared to the content manager; these scripts can then be injected into scripting nodes in the Data Flow. Click the folder icon (blue arrow above) to inject a shared Python script into the node. Your Script is written to the Script panel.

  • Click here to learn more about injecting a shared script.

Environment

Pyramid allows admins to create multiple virtual scripting environments; this enables Admins to run multiple versions or Python and R and multiple package versions. Choose the scripting environment that runs the required language and package versions (orange highlight above).

  • Click here to learn more about choosing a scripting environment.

Script

All scripts are shown in the Script panel (purple highlight above); including any script that is downloaded from the Marketplace (green arrow above), built in Formulate and injected from the share (blue arrow above), or manually written or pasted directly into the script panel.

Generate a Script

You can generate a script by clicking the Gen AI icon from the Properties panel and, in the Generate Your Script dialog, typing a “prompt” (description of your query) in natural language. Once you are ready, click Run. The AI uses its underlying LLM to generate a script based on your prompt. For more information, see Generate Your Script.

Explain Script

Use the Explain Script function to produce an AI-generated explanation of what the script does (note this is available even if the script was not itself AI-generated). Note: Each time you click the Explain Script button, a new explanation is generated. For more information, see Explain Script.

Input and Output panels

The Properties panel also includes Input and Output panels:

Note: When you download a script from the Marketplace, Pyramid automatically detects the inputs and outputs. When writing a script or choosing a shared script, you'll need to configure the input and output columns yourself.

Input

The Input panel is used to configure the columns that will be injected into the script (green arrow above).

To add all columns in the table as inputs, click Add all (purple arrow).

Output

The Output panel is used to configure the new columns that will be produced by the script (blue arrow).

To let Pyramid automatically detect the output from the script, click Auto Detect (yellow arrow).

You can also determine your Output Options (orange arrow), which determine where the new columns will be added:

  • Add To Existing Table: Adds any new columns to the existing table; that is, the table that the scripting node is connected to.
  • Create New Table: Stores the new columns in a new table.
  • Click here to learn more about scripting inputs and outputs.
  • Click here to learn more about the auto detect function.

Preview

Click Preview in the Properties panel to run the script and preview the results in the Preview panel. Any errors will be displayed in the Error panel.