Categories

Versions

You are viewing the RapidMiner Studio documentation for version 9.2 - Check here for latest version

Loop Labels (RapidMiner Studio Core)

Synopsis

This operator iterates over its subprocess for each attribute with label role in the input ExampleSet.

Description

The Loop Labels operator is a nested operator i.e. it has a subprocess. The subprocess of the Loop Labels operator executes n number of times, where n is the number of attributes with label role in the given ExampleSet. The important thing to note here is that one ExampleSet cannot have more than one attributes with label role. The trick is that this operator executes for each attribute whose 'role name' starts with the string 'label'. So, if an ExampleSet has attributes with role label, label2 and label3, then the subprocess of this operator will execute three times on it. The result of this operator is a collection of objects. Please study the attached Example Process for better understanding.

Input

  • example set (IOObject)

    This input port expects an ExampleSet. It is output of the Set Role operator in the attached Example Process.

Output

  • out (Collection)

    This operator can have multiple out output ports. When one output is connected, another out output port becomes available which is ready to deliver another output (if any). The order of outputs remains the same. The object delivered at the first out port of subprocess is delivered at the first out output port of the outer process. Do not forget to connect all outputs in correct order. Make sure that you have connected the right number of ports at all levels of the chain.

Tutorial Processes

Introduction to the Loop Labels operator

The 'Golf' data set is loaded using the Retrieve operator. A breakpoint is inserted here so that you can have a look at the ExampleSet. You can see that the ExampleSet has an attribute with label role i.e. the 'Play' attribute. The Set Role operator is applied on this ExampleSet to change the roles of the 'Wind' and 'Outlook' attributes to 'label2' and 'label3' respectively. A breakpoint is inserted here so that you can have a look at the ExampleSet before application of the Loop Labels operator. The Loop Labels operator is applied on the ExampleSet. There are three attributes with label roles therefore the subprocess of the Loop Labels operator will be executed three times; once for each label attribute. The results of each iteration will be merged into a collection which will be delivered as the result of this operator.

Have a look at the subprocess of the Loop Labels operator. The Decision Tree operator is applied there with default values of all parameters. In each iteration a Decision Tree will be generated for the current label. These trees will be returned in form of a collection by the Loop Labels operator. The resultant collection can be seen in the Results Workspace.