Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Hierarchical Classification
mattia_fumagall
Member Posts: 3 Contributor I
Dear All,
The following process performs a hierarchical classification on Iris.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="5.3.008" expanded="true" height="60" name="Retrieve Iris" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Samples/data/Iris"/>
</operator>
<operator activated="true" class="hierarchical_multi_class_classification" compatibility="5.3.008" expanded="true" height="76" name="Hierarchical Classification" width="90" x="179" y="30">
<list key="hierarchy">
<parameter key="versicolor_virginica" value="Iris-versicolor"/>
<parameter key="versicolor_virginica" value="Iris-virginica"/>
<parameter key="root" value="Iris-setosa"/>
<parameter key="root" value="versicolor_virginica"/>
</list>
<process expanded="true">
<operator activated="true" class="support_vector_machine" compatibility="5.3.008" expanded="true" height="112" name="SVM" width="90" x="179" y="30"/>
<connect from_port="training set" to_op="SVM" to_port="training set"/>
<connect from_op="SVM" from_port="model" to_port="model"/>
<portSpacing port="source_training set" spacing="0"/>
<portSpacing port="sink_model" spacing="0"/>
</process>
</operator>
<connect from_op="Retrieve Iris" from_port="output" to_op="Hierarchical Classification" to_port="training set"/>
<connect from_op="Hierarchical Classification" from_port="model" to_port="result 2"/>
<connect from_op="Hierarchical Classification" from_port="example set" 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"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
It works fine but if I apply the model to an exampleset, the
result is not showing the hierarchical labels --just the original labels
(iris-*). Is there a way to make the prediction use the parent labels
too --like another column?
I found an old solved topic in the fourm (https://community.rapidminer.com/discussion/23296/solved-hierarchical-classification-operator) where it is said that:
unfortunately that is not possible with a single operator. It is
possible to build a custom process that creates hierarchical labels, but
that is way more complex.
Please, have you any suggestion on how to to set up the custom process?Thank you in advance for your help!
Best regards,
Mattia
Tagged:
2
Best Answer
-
Telcontar120 RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 UnicornOne approach would be to build separate models for each level. So start by building a first model for the highest level category, then apply the model and get your predictions for that level. Then filter for each value in that label, and build another model for the next level classification and apply that model to it. You would need to loop through all the values of the first model to do that, and so on for as many different levels of the hierarchy that you had. This is pretty straightforward conceptually, but would require a bit of a complex setup in RapidMiner (loops within loops, depending on how many levels you have).7
Answers
PD: This is the modified XML.