RapidMiner

Multicriteria Optimization based on different models

RM Staff
RM Staff

Re: Multicriteria Optimization based on different models

Kind of. Try this instead:

 

<?xml version="1.0" encoding="UTF-8"?><process version="7.5.003">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="7.5.003" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve dataset xy" width="90" x="45" y="34">
        <parameter key="repository_entry" value="//dataset xy"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve Model_small" width="90" x="246" y="340">
        <parameter key="repository_entry" value="//Model_small"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve Model_large" width="90" x="45" y="187">
        <parameter key="repository_entry" value="//Model_large"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve Model_medium" width="90" x="112" y="289">
        <parameter key="repository_entry" value="//Model_Medium"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="7.5.003" expanded="true" height="82" name="Select Attributes" width="90" x="179" y="34">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="........."/>
      </operator>
      <operator activated="true" class="set_role" compatibility="7.5.003" expanded="true" height="82" name="Set Role" width="90" x="313" y="34">
        <parameter key="attribute_name" value="prediction(Class_Large)"/>
        <parameter key="target_role" value="pr1"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="7.5.003" expanded="true" height="82" name="Apply Model (2)" width="90" x="447" y="34">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="7.5.003" expanded="true" height="82" name="Select Attributes (2)" width="90" x="581" y="34">
        <parameter key="include_special_attributes" value="true"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="7.5.003" expanded="true" height="82" name="Set Role (2)" width="90" x="715" y="34">
        <parameter key="attribute_name" value="prediction(Class_Medium)"/>
        <parameter key="target_role" value="pr2"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="7.5.003" expanded="true" height="82" name="Apply Model" width="90" x="715" y="187">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="7.5.003" expanded="true" height="82" name="Set Role (3)" width="90" x="648" y="442">
        <parameter key="attribute_name" value="prediction(Class_Small)"/>
        <parameter key="target_role" value="pr3"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="7.5.003" expanded="true" height="82" name="Apply Model (3)" width="90" x="849" y="238">
        <list key="application_parameters"/>
      </operator>
      <connect from_op="Retrieve dataset xy" from_port="output" to_op="Select Attributes" to_port="example set input"/>
      <connect from_op="Retrieve Model_small" from_port="output" to_op="Apply Model (3)" to_port="model"/>
      <connect from_op="Retrieve Model_large" from_port="output" to_op="Apply Model (2)" to_port="model"/>
      <connect from_op="Retrieve Model_medium" from_port="output" to_op="Apply Model" to_port="model"/>
      <connect from_op="Select Attributes" from_port="example set output" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Set Role" from_port="example set output" to_op="Apply Model (2)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Select Attributes (2)" to_port="example set input"/>
      <connect from_op="Select Attributes (2)" from_port="original" to_op="Set Role (2)" to_port="example set input"/>
      <connect from_op="Set Role (2)" from_port="example set output" to_op="Apply Model" to_port="unlabelled data"/>
      <connect from_op="Apply Model" from_port="labelled data" to_op="Set Role (3)" to_port="example set input"/>
      <connect from_op="Set Role (3)" from_port="example set output" to_op="Apply Model (3)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (3)" from_port="labelled data" 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>
--------------------------------------------------------------------------
Head of Data Science Services at RapidMiner
Learner III a_metzmacher
Learner III

Re: Multicriteria Optimization based on different models

Good morning,

Thank you very much.

I just tried to change my xml code according to your suggestions. As it did not work at the first try, I tried to integrate variables called "pediction (Class_Small)".... into my dataset.

However, it still does not give out the desired results.

 

 

RM Staff
RM Staff

Re: Multicriteria Optimization based on different models

Hi,

 

What is the remaining issue?

 

Best,

Martin

--------------------------------------------------------------------------
Head of Data Science Services at RapidMiner
Learner III a_metzmacher
Learner III

Re: Multicriteria Optimization based on different models

I only receive values for the last predicted variable ("prediction(class_large)"), "prediction(class_medium)" is empty and "prediction(class_small)" does not exist in the final example set.

Highlighted
Learner III a_metzmacher
Learner III

Re: Multicriteria Optimization based on different models

I tried to conduct a data join with the three result example sets. For testing this, I tried to join only two (including predictions of "class_small" and "class_medium), but then I receive a warning that the attribute "class_small" has two different roles in the input sets (regular vs. label). Do you know how to solve this problem?

RM Staff
RM Staff

Re: Multicriteria Optimization based on different models

Hi,

 

i think you need to rename the attributes as well, see attached process.

 

Why are you doing this by the way? I have the odd feeling that Polynominal by Binominal Classification is the nice solution of your problem.

 

Best,

Martin

 

<?xml version="1.0" encoding="UTF-8"?><process version="7.5.003">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="7.5.003" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve dataset xy" width="90" x="45" y="34">
        <parameter key="repository_entry" value="//dataset xy"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve Model_small" width="90" x="179" y="544">
        <parameter key="repository_entry" value="//Model_small"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve Model_large" width="90" x="45" y="340">
        <parameter key="repository_entry" value="//Model_large"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="7.5.003" expanded="true" height="68" name="Retrieve Model_medium" width="90" x="45" y="442">
        <parameter key="repository_entry" value="//Model_Medium"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="7.5.003" expanded="true" height="82" name="Select Attributes" width="90" x="179" y="34">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="........."/>
      </operator>
      <operator activated="true" class="set_role" compatibility="7.5.003" expanded="true" height="82" name="Set Role" width="90" x="313" y="34">
        <parameter key="attribute_name" value="prediction(Class_Large)"/>
        <parameter key="target_role" value="pr1"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="7.5.003" expanded="true" height="82" name="Apply Model (2)" width="90" x="447" y="136">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="7.5.003" expanded="true" height="82" name="Select Attributes (2)" width="90" x="581" y="34">
        <parameter key="include_special_attributes" value="true"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="7.5.003" expanded="true" height="82" name="Set Role (2)" width="90" x="715" y="34">
        <parameter key="attribute_name" value="prediction(Class_Medium)"/>
        <parameter key="target_role" value="pr2"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="rename_by_replacing" compatibility="7.5.003" expanded="true" height="82" name="Rename by Replacing" width="90" x="782" y="136">
        <parameter key="include_special_attributes" value="true"/>
        <parameter key="replace_what" value="prediction\((.*)\)"/>
        <parameter key="replace_by" value="$1_FirstModel"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="7.5.003" expanded="true" height="82" name="Apply Model" width="90" x="782" y="238">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="7.5.003" expanded="true" height="82" name="Set Role (3)" width="90" x="916" y="289">
        <parameter key="attribute_name" value="prediction(Class_Small)"/>
        <parameter key="target_role" value="pr3"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="rename_by_replacing" compatibility="7.5.003" expanded="true" height="82" name="Rename by Replacing (2)" width="90" x="983" y="442">
        <parameter key="include_special_attributes" value="true"/>
        <parameter key="replace_what" value="prediction\((.*)\)"/>
        <parameter key="replace_by" value="$1_SecondModel"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="7.5.003" expanded="true" height="82" name="Apply Model (3)" width="90" x="1050" y="544">
        <list key="application_parameters"/>
      </operator>
      <connect from_op="Retrieve dataset xy" from_port="output" to_op="Select Attributes" to_port="example set input"/>
      <connect from_op="Retrieve Model_small" from_port="output" to_op="Apply Model (3)" to_port="model"/>
      <connect from_op="Retrieve Model_large" from_port="output" to_op="Apply Model (2)" to_port="model"/>
      <connect from_op="Retrieve Model_medium" from_port="output" to_op="Apply Model" to_port="model"/>
      <connect from_op="Select Attributes" from_port="example set output" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Set Role" from_port="example set output" to_op="Apply Model (2)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Select Attributes (2)" to_port="example set input"/>
      <connect from_op="Select Attributes (2)" from_port="original" to_op="Set Role (2)" to_port="example set input"/>
      <connect from_op="Set Role (2)" from_port="example set output" to_op="Rename by Replacing" to_port="example set input"/>
      <connect from_op="Rename by Replacing" from_port="example set output" to_op="Apply Model" to_port="unlabelled data"/>
      <connect from_op="Apply Model" from_port="labelled data" to_op="Set Role (3)" to_port="example set input"/>
      <connect from_op="Set Role (3)" from_port="example set output" to_op="Rename by Replacing (2)" to_port="example set input"/>
      <connect from_op="Rename by Replacing (2)" from_port="example set output" to_op="Apply Model (3)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (3)" from_port="labelled data" 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>

 

 

--------------------------------------------------------------------------
Head of Data Science Services at RapidMiner
Learner III a_metzmacher
Learner III

Re: Multicriteria Optimization based on different models

Thanks for your answer!

 

Actually, I want to determine certain attribute ranges of my input variables, which should lead to distinct values in my target variables.

As an example:

Attributes "weight"= 1000-2000g, "material"= Cu or Ni and "size"= 10-20mm lead to targets "class_small"=low, "class_medium"=low and "class_large"=high.

 

Does this somehow work in RapidMiner?

RM Staff
RM Staff

Re: Multicriteria Optimization based on different models

*Everything* can be done with Rapidminer! 

 

I think in this case the "Discretize" set of operators can come in handy. The problem will be much easier dealing with cathegorical variables. I would try training decision trees for each variable.

RM Staff
RM Staff

Re: Multicriteria Optimization based on different models

Hi,

 

have you considered to take this as an Association RUle problem instead of a supervised learning one?

 

 

Are you maybe attending IDS - we might catch a bit of time there. Details: http://ids2017.rapidminer.com/

 

Best,

Martin

--------------------------------------------------------------------------
Head of Data Science Services at RapidMiner