Pages: [1]
  Print  
Author Topic: Parallel execution of operators  (Read 1760 times)
test
Guest
« on: June 17, 2008, 10:58:53 AM »

Ok thanks.

Is it possible to apply operator in "parallel" ? I would like to filter input data that have RESULT A and RESULT B.
INPUT -> OPERATOR A -> RESULT A
INPUT -> OPERATOR B -> RESULT B

Operator seems to be chained in series:
INPUT -> OPERATOR A -> OPERATOR B -> RESULT C.
Logged
Tobias Malbrecht
Global Moderator
Sr. Member
*****
Posts: 293



WWW
« Reply #1 on: June 17, 2008, 11:24:51 AM »

Hi,

first of all: I hope you don't mind I put your questions in separate threads. That way, all users can easily recognize separate questions ...

Regarding your problem, yes, in general operators in the operator tree are executed as a chain. However you can achieve a setting like the one you mentioned by using loops, e.g. by applying the ParameterIteration operator.

Here is an example process:

Code:
<operator name="Root" class="Process" expanded="yes">
    <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
        <parameter key="target_function" value="simple polynomial classification"/>
    </operator>
    <operator name="ParameterIteration" class="ParameterIteration" expanded="yes">
        <parameter key="keep_output" value="true"/>
        <list key="parameters">
          <parameter key="OperatorSelector.select_which" value="1,2"/>
        </list>
        <operator name="OperatorSelector" class="OperatorSelector" expanded="yes">
            <parameter key="select_which" value="2"/>
            <operator name="ExampleFilter" class="ExampleFilter">
                <parameter key="condition_class" value="attribute_value_filter"/>
                <parameter key="parameter_string" value="att1&gt;0"/>
            </operator>
            <operator name="ExampleFilter (2)" class="ExampleFilter">
                <parameter key="condition_class" value="attribute_value_filter"/>
                <parameter key="parameter_string" value="att1&lt;0"/>
            </operator>
        </operator>
    </operator>
</operator>

Hope that helps,
regards,
Tobias
Logged

Tobias Malbrecht
Director of Product Marketing
RapidMiner
test
Guest
« Reply #2 on: June 17, 2008, 02:26:15 PM »

Thanks, I've installed the lasted code from CVS and it works.
However, I don't understand why you're using the following in OperatorSelector
<parameter key="select_which" value="2"/>

If I use:
<parameter key="select_which" value="1"/>

Then it works too. What's the meaning of this select_which ?
Logged
Tobias Malbrecht
Global Moderator
Sr. Member
*****
Posts: 293



WWW
« Reply #3 on: June 17, 2008, 08:04:44 PM »

Hi,

The thing is, that it does not matter what value is set in the OperatorSelector for the parameter select_which. This is, because the process contains the operator ParameterIteration. This operator iterates over parameters which you can specify. To select the first operator in the first iteration and the second operator in the second operator, you have to specify this in the ParameterIteration operator parameters. Hence, the process XML contains the lines

Code:
        <list key="parameters">
          <parameter key="OperatorSelector.select_which" value="1,2"/>
        </list>

which actually means exactly that the operator in the first iteration the value 1 is set for the parameter select_which, in the second iteration the value 2 is used for that parameter. The value you manually specify for the parameter select_which in the operator OperatorSelector is simply overwritten in that process.

Hope that clarifies how it works!
Regards,
Tobias
Logged

Tobias Malbrecht
Director of Product Marketing
RapidMiner
Pages: [1]
  Print  
 
Jump to: