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

Can I use Columns names macro in Pivot Operator?

sgnarkhede2016sgnarkhede2016 Member Posts: 152 Contributor II
Can I use Columns names macro in Pivot Operator?

If yes Can please help me out.

Answers

  • jwpfaujwpfau Employee-RapidMiner, Member Posts: 303 RM Engineering
    Hi,

    yes here is an example
    <?xml version="1.0" encoding="UTF-8"?><process version="9.9.000">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="9.4.000" expanded="true" name="Process" origin="GENERATED_TUTORIAL">
        <parameter key="logverbosity" value="init"/>
        <parameter key="random_seed" value="2001"/>
        <parameter key="send_mail" value="never"/>
        <parameter key="notification_email" value=""/>
        <parameter key="process_duration_for_mail" value="30"/>
        <parameter key="encoding" value="SYSTEM"/>
        <process expanded="true">
          <operator activated="true" class="retrieve" compatibility="9.9.000" expanded="true" height="68" name="Retrieve Titanic" origin="GENERATED_TUTORIAL" width="90" x="45" y="34">
            <parameter key="repository_entry" value="//Samples/data/Titanic"/>
          </operator>
          <operator activated="true" class="set_macro" compatibility="9.9.000" expanded="true" height="82" name="Set Macro" width="90" x="179" y="34">
            <parameter key="macro" value="sex_column"/>
            <parameter key="value" value="Sex"/>
          </operator>
          <operator activated="true" class="nominal_to_numerical" compatibility="9.9.000" expanded="true" height="103" name="Nominal to Numerical" origin="GENERATED_TUTORIAL" width="90" x="313" y="34">
            <parameter key="return_preprocessing_model" value="false"/>
            <parameter key="create_view" value="false"/>
            <parameter key="attribute_filter_type" value="single"/>
            <parameter key="attribute" value="Survived"/>
            <parameter key="attributes" value=""/>
            <parameter key="use_except_expression" value="false"/>
            <parameter key="value_type" value="nominal"/>
            <parameter key="use_value_type_exception" value="false"/>
            <parameter key="except_value_type" value="file_path"/>
            <parameter key="block_type" value="single_value"/>
            <parameter key="use_block_type_exception" value="false"/>
            <parameter key="except_block_type" value="single_value"/>
            <parameter key="invert_selection" value="false"/>
            <parameter key="include_special_attributes" value="false"/>
            <parameter key="coding_type" value="dummy coding"/>
            <parameter key="use_comparison_groups" value="false"/>
            <list key="comparison_groups"/>
            <parameter key="unexpected_value_handling" value="all 0 and warning"/>
            <parameter key="use_underscore_in_name" value="false"/>
          </operator>
          <operator activated="true" class="set_macro" compatibility="9.9.000" expanded="true" height="82" name="Set Macro (2)" width="90" x="447" y="34">
            <parameter key="macro" value="has_survived_column"/>
            <parameter key="value" value="Survived = Yes"/>
          </operator>
          <operator activated="true" class="blending:pivot" compatibility="9.2.001" expanded="true" height="82" name="Pivot" origin="GENERATED_TUTORIAL" width="90" x="648" y="34">
            <parameter key="group_by_attributes" value="Passenger Class"/>
            <parameter key="column_grouping_attribute" value="%{sex_column}"/>
            <list key="aggregation_attributes">
              <parameter key="%{has_survived_column}" value="average"/>
            </list>
            <parameter key="use_default_aggregation" value="false"/>
            <parameter key="default_aggregation_function" value="first"/>
          </operator>
          <connect from_op="Retrieve Titanic" from_port="output" to_op="Set Macro" to_port="through 1"/>
          <connect from_op="Set Macro" from_port="through 1" to_op="Nominal to Numerical" to_port="example set input"/>
          <connect from_op="Nominal to Numerical" from_port="example set output" to_op="Set Macro (2)" to_port="through 1"/>
          <connect from_op="Set Macro (2)" from_port="through 1" to_op="Pivot" to_port="input"/>
          <connect from_op="Pivot" from_port="output" 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>

    Greetings,
    Jonas

Sign In or Register to comment.