Synopsis
This operator can be used to define a single macro which can be used by %{my_macro} in parameter values. The macro value will be derived from the input
Description
This operator (re-)defines a macro for the current process. Macros will be replaced in the value strings of parameters by the macros' values, see Macros section below. In contrast to the usual Set Macro operator, this operator sets the value of a single macro from properties of a given input ExampleSet, e.g. from properties like the number of examples or attributes or from a specific data value. The name of the macro must be specified in the macro parameter and the way the value is retrieved from the ExampleSet must be chosen from macro_type.
Macros
A defined macro can then be used in all succeeding operators as parameter value for parameters. A macro must then be enclosed by "%{" and "}".
There are several predefined macros:
- %{process_name}: will be replaced by the name of the process (without path and extension)
- %{process_file}: will be replaced by the file name of the process (with extension)
- %{process_path}: will be replaced by the complete absolute path of the process file
In addition to those the user might define arbitrary other macros which will be replaced by arbitrary string during the process run. Please note also that several other short macros exist, e.g. %{a} for the number of times the current operator was applied. Please note also that other operators like many of the loop operators like Loop Values or Loop Attributes also add specific macros.
Input
- example set: expects: ExampleSet, expects: ExampleSet
Output
- example set:
Parameters
- macro: The macro name defined by the user.
- macro type: Indicates the way how the macro should be defined.
- statistics: The statistics of the specified attribute which should be used as macro value.
- attribute name: The name of the attribute from which the data should be derived.
- attribute value: The value of the attribute which should be counted.
- example index: The index of the example from which the data should be derived. Negative indices are counted from the end of the data set. Positive counting starts with 1, negative counting with -1.