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
using loop parameters info for renaming
hi everyone,
not sure if the logic of what i'm doing is right, so here is the problem:
- i generated sequences of nominal values which i want to compare with a test sequence
- i want to use a loop to run different distance measures
- then collate the whole thing in a single table for exporting
the first script does it with separate streams/processes and then i join them (i'll have to post this separate because of the char limit)
the second one tries to do the same using a loop parameter block, but i don't seem to be able to make it work (see below)
any suggestion will be very much appreciated!
Lorenzo
not sure if the logic of what i'm doing is right, so here is the problem:
- i generated sequences of nominal values which i want to compare with a test sequence
- i want to use a loop to run different distance measures
- then collate the whole thing in a single table for exporting
the first script does it with separate streams/processes and then i join them (i'll have to post this separate because of the char limit)
the second one tries to do the same using a loop parameter block, but i don't seem to be able to make it work (see below)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.3.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.3.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" breakpoints="after" class="subprocess" compatibility="6.3.000" expanded="true" height="112" name="Subprocess" width="90" x="45" y="120">
<process expanded="true">
<operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification (3)" width="90" x="380" y="30">
<list key="attribute_values">
<parameter key="att1" value="1"/>
<parameter key="att2" value="2"/>
<parameter key="att3" value="3"/>
<parameter key="att4" value="4"/>
<parameter key="att5" value="5"/>
</list>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="45" y="30">
<list key="attribute_values">
<parameter key="att1" value="1"/>
<parameter key="att2" value="2"/>
<parameter key="att3" value="3"/>
<parameter key="att4" value="4"/>
<parameter key="att5" value="5"/>
</list>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="loop" compatibility="6.3.000" expanded="true" height="76" name="Loop" width="90" x="246" y="300">
<parameter key="iterations" value="100"/>
<process expanded="true">
<operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification (4)" width="90" x="179" y="30">
<list key="attribute_values">
<parameter key="att1" value="floor((rand()*9))"/>
<parameter key="att2" value="floor((rand()*9))"/>
<parameter key="att3" value="floor((rand()*9))"/>
<parameter key="att4" value="floor((rand()*9))"/>
<parameter key="att5" value="floor((rand()*9))"/>
</list>
<list key="set_additional_roles"/>
</operator>
<connect from_op="Generate Data by User Specification (4)" from_port="output" to_port="output 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
<portSpacing port="sink_output 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="generate_id" compatibility="6.3.000" expanded="true" height="76" name="Generate ID" width="90" x="514" y="30">
<parameter key="create_nominal_ids" value="true"/>
</operator>
<operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification (2)" width="90" x="45" y="120">
<list key="attribute_values">
<parameter key="att1" value="1"/>
<parameter key="att2" value="2"/>
<parameter key="att3" value="3"/>
<parameter key="att4" value="4"/>
<parameter key="att5" value="5"/>
</list>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification (5)" width="90" x="45" y="210">
<list key="attribute_values">
<parameter key="att1" value="1"/>
<parameter key="att2" value="3"/>
<parameter key="att3" value="2"/>
<parameter key="att4" value="4"/>
<parameter key="att5" value="5"/>
</list>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification (6)" width="90" x="45" y="300">
<list key="attribute_values">
<parameter key="att1" value="1"/>
<parameter key="att2" value="2"/>
<parameter key="att3" value="3"/>
<parameter key="att4" value="6"/>
<parameter key="att5" value="7"/>
</list>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="append" compatibility="6.3.000" expanded="true" height="148" name="Append" width="90" x="246" y="75"/>
<operator activated="true" class="generate_id" compatibility="6.3.000" expanded="true" height="76" name="Generate ID (2)" width="90" x="514" y="120">
<parameter key="create_nominal_ids" value="true"/>
</operator>
<connect from_op="Generate Data by User Specification (3)" from_port="output" to_op="Generate ID" to_port="example set input"/>
<connect from_op="Generate Data by User Specification" from_port="output" to_op="Append" to_port="example set 1"/>
<connect from_op="Loop" from_port="output 1" to_op="Append" to_port="example set 5"/>
<connect from_op="Generate ID" from_port="example set output" to_port="out 1"/>
<connect from_op="Generate Data by User Specification (2)" from_port="output" to_op="Append" to_port="example set 2"/>
<connect from_op="Generate Data by User Specification (5)" from_port="output" to_op="Append" to_port="example set 3"/>
<connect from_op="Generate Data by User Specification (6)" from_port="output" to_op="Append" to_port="example set 4"/>
<connect from_op="Append" from_port="merged set" to_op="Generate ID (2)" to_port="example set input"/>
<connect from_op="Generate ID (2)" from_port="example set output" to_port="out 2"/>
<portSpacing port="source_in 1" spacing="0"/>
<portSpacing port="sink_out 1" spacing="0"/>
<portSpacing port="sink_out 2" spacing="162"/>
<portSpacing port="sink_out 3" spacing="0"/>
<portSpacing port="sink_out 4" spacing="0"/>
</process>
</operator>
<operator activated="true" class="multiply" compatibility="6.3.000" expanded="true" height="76" name="Multiply (2)" width="90" x="179" y="210"/>
<operator activated="true" class="multiply" compatibility="6.3.000" expanded="true" height="76" name="Multiply" width="90" x="179" y="75"/>
<operator activated="true" class="loop_parameters" compatibility="6.3.000" expanded="true" height="94" name="Loop Parameters" width="90" x="447" y="210">
<list key="parameters">
<parameter key="Cross Distances (2).numerical_measure" value="EuclideanDistance,CamberraDistance,ManhattanDistance"/>
</list>
<process expanded="true">
<operator activated="true" class="cross_distances" compatibility="6.3.000" expanded="true" height="94" name="Cross Distances (2)" width="90" x="112" y="120"/>
<operator activated="true" class="generate_macro" compatibility="6.3.000" expanded="true" height="76" name="Generate Macro" width="90" x="313" y="120">
<list key="function_descriptions">
<parameter key="colName" value="%{iteration}_model"/>
</list>
</operator>
<operator activated="true" class="generate_id" compatibility="6.3.000" expanded="true" height="76" name="Generate ID (4)" width="90" x="447" y="120">
<parameter key="create_nominal_ids" value="true"/>
</operator>
<operator activated="true" class="rename" compatibility="6.3.000" expanded="true" height="76" name="Rename (2)" width="90" x="581" y="120">
<parameter key="old_name" value="distance"/>
<parameter key="new_name" value="%{colName}"/>
<list key="rename_additional_attributes"/>
</operator>
<connect from_port="input 1" to_op="Cross Distances (2)" to_port="request set"/>
<connect from_port="input 2" to_op="Cross Distances (2)" to_port="reference set"/>
<connect from_op="Cross Distances (2)" from_port="result set" to_op="Generate Macro" to_port="through 1"/>
<connect from_op="Generate Macro" from_port="through 1" to_op="Generate ID (4)" to_port="example set input"/>
<connect from_op="Generate ID (4)" from_port="example set output" to_op="Rename (2)" to_port="example set input"/>
<connect from_op="Rename (2)" from_port="example set output" to_port="performance"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="source_input 3" spacing="0"/>
<portSpacing port="sink_performance" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
<connect from_op="Subprocess" from_port="out 1" to_op="Multiply" to_port="input"/>
<connect from_op="Subprocess" from_port="out 2" to_op="Multiply (2)" to_port="input"/>
<connect from_op="Subprocess" from_port="out 3" to_port="result 1"/>
<connect from_op="Multiply (2)" from_port="output 1" to_op="Loop Parameters" to_port="input 2"/>
<connect from_op="Multiply" from_port="output 1" to_op="Loop Parameters" to_port="input 1"/>
<connect from_op="Loop Parameters" from_port="result 1" to_port="result 2"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
any suggestion will be very much appreciated!
Lorenzo
Tagged:
0
Answers