Pages: [1]
  Print  
Author Topic: Output of IteratingOperatorChain  (Read 935 times)
pser
Newbie
*
Posts: 8


« on: May 29, 2009, 04:56:38 PM »

Hello,

I experienced a problem with IteratingOperatorChain. I want to create two TextObjects (with the appropriate operator from the Text Plugin) and convert them to ExampleSets. For convenience I want to do the conversion inside an IteratingOperatorChain. Here is what happens: When I start the IteratingOperatorChain there are two TextObjects in the input, then one is converted to an ExampleSet, then the other is converted, too. But now when the IteratingOperatorChain is left, the second TextObject is again added to the Output, so I finish with two ExampleSets and one TextObject! Of course I could get rid of this superfluous TextObject with IOConsumer but that would get unhandy in larger processes.

Is there an elegant way of preventing IteratingOperatorChain from adding the second TextObject to its output?

Here's the process description:

Code:
<operator name="Root" class="Process" expanded="yes">
    <parameter key="logverbosity" value="error"/>
    <parameter key="logfile" value="%{process_name}.log"/>
    <parameter key="random_seed" value="-1"/>
    <operator name="SingleTextObjectInput" class="SingleTextObjectInput">
        <parameter key="text" value="&quot;&quot;"/>
        <parameter key="label" value="1"/>
    </operator>
    <operator name="SingleTextObjectInput (2)" class="SingleTextObjectInput">
        <parameter key="text" value="&quot;&quot;"/>
        <parameter key="label" value="2"/>
    </operator>
    <operator name="IteratingOperatorChain" class="IteratingOperatorChain" expanded="yes">
        <parameter key="iterations" value="2"/>
        <operator name="TextObject2ExampleSet" class="TextObject2ExampleSet">
            <parameter key="text_attribute" value="text"/>
            <parameter key="label_attribute" value="label"/>
        </operator>
    </operator>
</operator>

Thanks in advance,
Daniel
Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 448



WWW
« Reply #1 on: June 02, 2009, 09:01:32 AM »

Hi Daniel,

unfortunately, there is no easier way built into the IteratingOperatorChain directly. Admittedly, the current behaviour of the IteratingOperatorChain isn't particularly intuitive. This will be changed in 5.0.

However, note that the IOConsumer can consume all TextObjects at once, so this should not be too unhandy in larger processes.

Cheers,
Simon
Logged

Simon Fischer, Rapid-I
RapidMiner Development on Twitter: @simon_fis
Pages: [1]
  Print  
 
Jump to: