Parameters are user-defined variables that are saved and persisted with the current flow or SuperNode. Parameters are often used in scripting to control the behavior of the script, and they can be accessed from the user interface as well.
You can define parameters for use in CLEM expressions and in scripting. Parameters that are defined in the flow properties are available to all nodes in the flow. This availability of parameters distinguishes them from local script variables, which can be used only in the script in which they are declared.
If you save a flow, any parameters set for that flow are also saved.
You can set flow parameters in a flow script or the flow properties. For more information about setting flow properties, see Setting properties for flows
Parameters in CLEM expressions
Parameters are represented in CLEM expressions by $P-pname
, where
pname
is the name of the parameter. When used in CLEM expressions, parameters
must be placed within single quotation marks, for example, '$P-scale'
.
Parameters in scripting
You can provide information for fields and values by using a parameter so that you don't need
to hardcode values in the script. For example, you can create a minvalue
parameter, and then you can use this parameter for different operations in the current flow,
such as selecting records higher or lower than this threshold. And you can change the value for
the threshold as you need.
Parameters in SuperNodes
Any parameters set for a SuperNode are available when you build CLEM expressions in that SuperNode or any nested nodes. Parameters set for a SuperNode are not available outside of the SuperNode.
You can use parameters to manage the settings for nodes within a SuperNode. This method saves
time as you don't need to configure nodes directly. For example, you want to train a
Neural Net node within a SuperNode for a specific length of time by
using a random sample of the data available in a Sample node. You can
use parameters to specify values for the length of time and the percentage sample. You can
customize the properties for the nodes so that the Sample setting is
Random % in the Sample node and the
Stopping Rules setting is Use maximum training
time in the Neural Net node. You can then create
parameters for the SuperNode, such as Train.time
and
Sample.random
, to access the node properties and specify values. Once you
define these parameters, you can easily modify values for these settings in the two nodes by
setting the values for the parameters in the SuperNode.