The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Loop Operator input and output problem"
In the "Loop" operator description it says:
while when I use it to do iterated splittings, the input is always the same for each iteration.
My purpose is just to split a data set into subset1 and 2 and then split subset1 into subset 3 and 4 and so on. The code is here:
.
The output of each nested operator is the input for the following one, the output of the last inner operator will be the input for the first child in the next iteration. The output of the last operator in the last iteration will be the output of this operator.
while when I use it to do iterated splittings, the input is always the same for each iteration.
My purpose is just to split a data set into subset1 and 2 and then split subset1 into subset 3 and 4 and so on. The code is here:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>My expectation is that the output in iteration1 is the input of iteration 2 so after 2 iterations the output sample size should be 36=0.6*0.6*100 (100 is the original sample size,0.6 is just a ratio) while it is still 60=0.6*100. Hope I make it clear...Thanks for any help:)
<process version="5.0">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" expanded="true" name="Process">
<process expanded="true" height="521" width="820">
<operator activated="true" class="generate_data" expanded="true" height="60" name="Generate Data" width="90" x="45" y="75"/>
<operator activated="true" class="loop" expanded="true" height="76" name="Loop" width="90" x="179" y="120">
<parameter key="iterations" value="2"/>
<process expanded="true" height="488" width="877">
<operator activated="true" class="split_data" expanded="true" height="76" name="Split Data" width="90" x="112" y="120">
<enumeration key="partitions">
<parameter key="ratio" value="0.6"/>
<parameter key="ratio" value="0.4"/>
</enumeration>
</operator>
<connect from_port="input 1" to_op="Split Data" to_port="example set"/>
<connect from_op="Split Data" from_port="partition 1" to_port="output 1"/>
<portSpacing port="source_input 1" spacing="90"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
<portSpacing port="sink_output 2" spacing="0"/>
</process>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Loop" to_port="input 1"/>
<connect from_op="Loop" from_port="output 1" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
I agree that the documentation is not as clear as it might be, but it may actually true! If you want to do recursion you may be better off storing, manipulating, and retrieving the dataset explicitly, like this.. Clunky, yes, but it produces 36 examples