Skip to main content

Loop Attributes

Synopsis

This operator selects a subset (one or more attributes) of the input ExampleSet and iterates over its subprocess for all the selected attributes. The subprocess can access the attribute of current iteration by a macro.

Description

The Loop Attributes operator has a number of parameters that allow you to select the required attributes of the input ExampleSet. Once the attributes are selected, the Loop Attributes operator applies its subprocess for each attribute i.e. the subprocess executesnnumber of times wherenis the number of selected attributes. In all iterations the attribute of the current iteration can be accessed using the macro specified in theiteration macroparameter. You need to have basic understanding of macros in order to apply this operator. Please study the documentation of theExtract Macrooperator for basic understanding of macros. The Extract Macro operator is also used in the attached Example Process. For more information regarding subprocesses please study theSubprocessoperator.

Input

example set

预计一个ExampleSet这个输入端口。这是阿utput of the Retrieve operator in the attached Example Process. The output of other operators can also be used as input.

Output

example set

The resultant ExampleSet, or Collection of ExampleSets is delivered through this port.

Parameters

Attribute filter type

This parameter allows you to select the attribute selection filter; the method you want to use for selecting attributes. It has the following options:

  • all: This option simply selects all the attributes of the ExampleSet, no attributes are removed. This is the default option.
  • single: This option allows the selection of a single attribute. When this option is selected another parameter (attribute) becomes visible in the Parameters panel.
  • subset: This option allows the selection of multiple attributes through a list. All attributes of ExampleSet are present in the list; required attributes can be easily selected. This option will not work if the meta data is not known. When this option is selected another parameter becomes visible in the Parameters panel.
  • regular_expression: This option allows you to specify a regular expression for the attribute selection. When this option is selected some other parameters (regular expression, use except expression) become visible in the Parameters panel.
  • value_type: This option allows selection of all the attributes of a particular type. It should be noted that types are hierarchical. For examplerealandintegertypes both belong to thenumerictype. The user should have a basic understanding of type hierarchy when selecting attributes through this option. When this option is selected some other parameters (value type, use value type exception) become visible in the Parameters panel.
  • block_type: This option is similar in working to thevalue_type选择。这个选项允许所有th的选择e attributes of a particular block type. It should be noted that block types may be hierarchical. For examplevalue_series_startandvalue_series_endblock types both belong to thevalue_seriesblock type. When this option is selected some other parameters (block type, use block type exception) become visible in the Parameters panel.
  • no_missing_values: This option simply selects all the attributes of the ExampleSet which don't contain a missing value in any example. Attributes that have even a single missing value are removed.
  • numeric_value_filter: When this option is selected another parameter (numeric condition) becomes visible in the Parameters panel. All numeric attributes whose examples all satisfy the mentioned numeric condition are selected. Please note that all nominal attributes are also selected irrespective of the given numerical condition.

Attribute

The required attribute can be selected from this option. The attribute name can be selected from the drop down box of theattributeparameter if the meta data is known.

Attributes

The required attributes can be selected from this option. This opens a new window with two lists. All attributes are present in the left list and can be shifted to the right list, which is the list of selected attributes that will make it to the output port; all other attributes will be removed.

Regular expression

The attributes whose name match this expression will be selected. Regular expression is very powerful tool but needs a detailed explanation to beginners. It is always good to specify the regular expression through theedit and preview regular expressionmenu. This menu gives a good idea of regular expressions and it also allows you to try different expressions and preview the results simultaneously. This will enhance your concept of regular expressions.

Use except expression

If enabled, an exception to the first regular expression can be specified. When this option is selected another parameter (except regular expression) becomes visible in the Parameters panel.

Except regular expression

This option allows you to specify a regular expression. Attributes matching this expression will be filtered out even if they match the first expression (expression that was specified inregular expressionparameter).

Value type

The type of attributes to be selected can be chosen from a drop down list. One of the following types can be chosen: nominal, numeric, integer, real, text, binominal, polynominal, file_path, date_time, date, time.

Use value type exception

If enabled, an exception to the selected type can be specified. When this option is selected another parameter (except value type) becomes visible in the Parameters panel.

Except value type

The attributes matching this type will be removed from the final output even if they matched the previously mentioned type i.e. thevalue typeparameter's value. One of the following types can be selected here: nominal, numeric, integer, real, text, binominal, polynominal, file_path, date_time, date, time.

Block type

The Block type of attributes to be selected can be chosen from a drop down list. One of the following types can be chosen: single_value, value_series, value_series_start, value_series_end, value_matrix, value_matrix_start, value_matrix_end, value_matrix_row_start.

Use block type exception

If enabled, an exception to the selected block type can be specified. When this option is selected another parameter (except block type) becomes visible in the Parameters panel.

Except block type

The attributes matching this block type will be removed from the final output even if they matched the previously mentioned block type. One of the following block types can be selected here: single_value, value_series, value_series_start, value_series_end, value_matrix, value_matrix_start, value_matrix_end, value_matrix_row_start.

Numeric condition

数字条件测试nume的例子ric attributes is mention here. For example the numeric condition '>6' will keep all nominal attributes and all numeric attributes having a value of greater than 6 in every example. A combination of conditions is possible: '>6 &&<11' or '<= 5 ||<0'. But && and || cannot be used together in one numeric condition. Conditions like '(>0 &&<2) || (>10 &&<12)' are not allowed because they use both && and ||. Use a blank space after '>', '=' and '<' e.g. '<5' will not work, so use '<5' instead.

Invert selection

If this parameter set to true, it acts as a NOT gate, it reverses the selection. In that case all the selected attributes are removed and previously removed attributes are selected. For example if attribute 'att1' is selected and attribute 'att2' is removed prior to selection of this parameter. After selection of this parameter 'att1' will be removed and 'att2' will be selected.

Include special attributes

Special attributes are attributes with special roles which identify the examples. In contrast regular attributes simply describe the examples. Special attributes are: id, label, prediction, cluster, weight and batch. By default all special attributes are delivered to the output port irrespective of the conditions in the Select Attribute operator. If this parameter is set to true, Special attributes are also tested against conditions specified in the Select Attribute operator and only those attributes are selected that satisfy the conditions.

Attribute name macro

This parameter specifies the name of the macro which holds the name of the current attribute in each iteration.

Reuse results

Set whether to reuse the results of each iteration as the input of the next iteration. If set to true, the output of each iteration is used as input for the next iteration. For obvious reasons, this will limit the loop to run in a single thread and not make use of more CPU cores. If set to false, the input of each iteration will be the original input of the loop.

Enable parallel execution

This parameter enables the parallel execution of the subprocess. Please disable the parallel execution if you run into memory problems.