"Decision Tree - Multiple Target Column"

j_priesj_pries Member Posts: 1 Learner I
edited May 2019 in Help



I´m a german student and on a study research for automated selection of grippers according to input-properties of objects. I want to use a decision tree.

The problem is that there are more than one possible gripping principles for an object. For example, a cube can be gripped by clamping and suction grippers. Is it possible to use more than one target column in training data or how can solve the problem?

Thanks for Your help!


Best Answer

  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Solution Accepted

    You can't have more than one target column (called a label in RapidMiner) at the same time in RapidMiner.

    However, you could build multiple DT models using different labels and then combine their predictions.  Or you could create a new single label that incorporates information from mulitple original separate target columns using Generate Attributes (e.g., maybe you create a single label to indicate if an object can be picked up using neither method, one method, or both methods).

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts


  • Options
    JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn

    Here's an example of using Loop Labels.


    <?xml version="1.0" encoding="UTF-8"?><process version="9.0.002">
    <operator activated="true" class="process" compatibility="9.0.002" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="subprocess" compatibility="9.0.002" expanded="true" height="82" name="Some data" width="90" x="45" y="34">
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="9.0.002" expanded="true" height="68" name="Retrieve Sonar" width="90" x="45" y="34">
    <parameter key="repository_entry" value="//Samples/data/Sonar"/>
    <operator activated="true" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes" width="90" x="179" y="34">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="class"/>
    <parameter key="invert_selection" value="true"/>
    <parameter key="include_special_attributes" value="true"/>
    <operator activated="true" class="generate_attributes" compatibility="9.0.002" expanded="true" height="82" name="Generate Attributes" width="90" x="313" y="34">
    <list key="function_descriptions">
    <parameter key="suction_gripper" value="if(rand(99)&gt;0.5,1,0)"/>
    <parameter key="clamping_gripper" value="if(rand(20)&gt;0.5,1,0)"/>
    <operator activated="true" class="numerical_to_binominal" compatibility="9.0.002" expanded="true" height="82" name="Numerical to Binominal" width="90" x="380" y="136">
    <parameter key="attribute_filter_type" value="subset"/>
    <parameter key="attributes" value="clamping_gripper|suction_gripper"/>
    <parameter key="include_special_attributes" value="true"/>
    <connect from_op="Retrieve Sonar" from_port="output" to_op="Select Attributes" to_port="example set input"/>
    <connect from_op="Select Attributes" from_port="example set output" to_op="Generate Attributes" to_port="example set input"/>
    <connect from_op="Generate Attributes" from_port="example set output" to_op="Numerical to Binominal" to_port="example set input"/>
    <connect from_op="Numerical to Binominal" from_port="example set output" to_port="out 1"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    <operator activated="true" class="set_role" compatibility="9.0.002" expanded="true" height="82" name="Set Role" width="90" x="179" y="34">
    <parameter key="attribute_name" value="clamping_gripper"/>
    <parameter key="target_role" value="label1"/>
    <list key="set_additional_roles">
    <parameter key="suction_gripper" value="label2"/>
    <description align="center" color="transparent" colored="false" width="126">Set Role of label columns to label1, label2</description>
    <operator activated="true" class="loop_labels" compatibility="9.0.002" expanded="true" height="82" name="Loop Labels" width="90" x="313" y="34">
    <process expanded="true">
    <operator activated="true" class="concurrency:parallel_decision_tree" compatibility="9.0.002" expanded="true" height="103" name="Decision Tree" width="90" x="112" y="34"/>
    <operator activated="true" class="collect" compatibility="9.0.002" expanded="true" height="103" name="Collect" width="90" x="313" y="34"/>
    <connect from_port="example set" to_op="Decision Tree" to_port="training set"/>
    <connect from_op="Decision Tree" from_port="model" to_op="Collect" to_port="input 1"/>
    <connect from_op="Decision Tree" from_port="exampleSet" to_op="Collect" to_port="input 2"/>
    <connect from_op="Collect" from_port="collection" to_port="out 1"/>
    <portSpacing port="source_example set" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    <description align="center" color="transparent" colored="false" width="126">Don;t forget to use validation</description>
    <operator activated="true" class="loop_collection" compatibility="9.0.002" expanded="true" height="103" name="Loop Collection" width="90" x="447" y="34">
    <process expanded="true">
    <operator activated="true" class="multiply" compatibility="9.0.002" expanded="true" height="103" name="Multiply" width="90" x="-23" y="34"/>
    <operator activated="true" class="select" compatibility="9.0.002" expanded="true" height="68" name="Select" width="90" x="45" y="34"/>
    <operator activated="true" class="select" compatibility="9.0.002" expanded="true" height="68" name="Select (2)" width="90" x="45" y="136">
    <parameter key="index" value="2"/>
    <operator activated="true" class="apply_model" compatibility="9.0.002" expanded="true" height="82" name="Apply Model" width="90" x="313" y="34">
    <list key="application_parameters"/>
    <connect from_port="single" to_op="Multiply" to_port="input"/>
    <connect from_op="Multiply" from_port="output 1" to_op="Select" to_port="collection"/>
    <connect from_op="Multiply" from_port="output 2" to_op="Select (2)" to_port="collection"/>
    <connect from_op="Select" from_port="selected" to_op="Apply Model" to_port="model"/>
    <connect from_op="Select (2)" from_port="selected" to_op="Apply Model" to_port="unlabelled data"/>
    <connect from_op="Apply Model" from_port="labelled data" to_port="output 1"/>
    <connect from_op="Apply Model" from_port="model" to_port="output 2"/>
    <portSpacing port="source_single" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    <portSpacing port="sink_output 3" spacing="0"/>
    <description align="center" color="transparent" colored="false" width="126">You can combine models or score them separately like this example.</description>
    <connect from_op="Some data" from_port="out 1" to_op="Set Role" to_port="example set input"/>
    <connect from_op="Set Role" from_port="example set output" to_op="Loop Labels" to_port="example set"/>
    <connect from_op="Loop Labels" from_port="out 1" to_op="Loop Collection" to_port="collection"/>
    <connect from_op="Loop Collection" from_port="output 1" to_port="result 1"/>
    <connect from_op="Loop Collection" from_port="output 2" 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"/>
Sign In or Register to comment.