[solved] Example application for Log-Operator

fras
fras New Altair Community Member
edited November 5 in Community Q&A
Hi!
From the help of operator "Log" I get the hint
to read an example from "Advanced Processes/Parameter and performance analysis".
But it seems to be in RM-Tutorial 4.4. Is there a newer one ?
Background: I want to collect (aggregated) fields from an example set also into the log.
Cheers, Frank

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
   <process expanded="true" height="568" width="587">
     <operator activated="true" class="generate_data" compatibility="5.2.008" expanded="true" height="60" name="Generate Data" width="90" x="45" y="300">
       <parameter key="target_function" value="random classification"/>
     </operator>
     <operator activated="true" class="aggregate" compatibility="5.2.008" expanded="true" height="76" name="Aggregate" width="90" x="179" y="120">
       <list key="aggregation_attributes">
         <parameter key="att1" value="sum"/>
       </list>
       <parameter key="group_by_attributes" value="label|"/>
     </operator>
     <operator activated="true" class="log" compatibility="5.2.008" expanded="true" height="76" name="Log" width="90" x="313" y="120">
       <parameter key="filename" value="/home/fras/test.log"/>
       <list key="log">
         <parameter key="field01" value="operator.Aggregate.parameter.attribute"/>
         <parameter key="field02" value="operator.Aggregate.parameter.attributes"/>
       </list>
     </operator>
     <connect from_op="Generate Data" from_port="output" to_op="Aggregate" to_port="example set input"/>
     <connect from_op="Aggregate" from_port="example set output" to_op="Log" to_port="through 1"/>
     <connect from_op="Log" from_port="through 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:

Answers

  • MariusHelf
    MariusHelf New Altair Community Member
    Hi,

    Extract Log Value is your friend:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.2.008">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
        <process expanded="true" height="568" width="614">
          <operator activated="true" class="generate_data" compatibility="5.2.008" expanded="true" height="60" name="Generate Data" width="90" x="45" y="120">
            <parameter key="target_function" value="random classification"/>
          </operator>
          <operator activated="true" class="aggregate" compatibility="5.2.008" expanded="true" height="76" name="Aggregate" width="90" x="179" y="120">
            <list key="aggregation_attributes">
              <parameter key="att1" value="sum"/>
            </list>
            <parameter key="group_by_attributes" value="label|"/>
          </operator>
          <operator activated="true" class="extract_log_value" compatibility="5.2.008" expanded="true" height="60" name="Extract Log Value" width="90" x="313" y="120">
            <parameter key="attribute_name" value="sum(att1)"/>
            <parameter key="example_index" value="1"/>
          </operator>
          <operator activated="true" class="log" compatibility="5.2.008" expanded="true" height="76" name="Log" width="90" x="447" y="120">
            <parameter key="filename" value="/home/fras/test.log"/>
            <list key="log">
              <parameter key="field01" value="operator.Aggregate.parameter.attribute"/>
              <parameter key="field02" value="operator.Aggregate.parameter.attributes"/>
              <parameter key="sum" value="operator.Extract Log Value.value.data_value"/>
            </list>
          </operator>
          <connect from_op="Generate Data" from_port="output" to_op="Aggregate" to_port="example set input"/>
          <connect from_op="Aggregate" from_port="example set output" to_op="Extract Log Value" to_port="example set"/>
          <connect from_op="Extract Log Value" from_port="example set" to_op="Log" to_port="through 1"/>
          <connect from_op="Log" from_port="through 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>
    Best, Marius