"How to speciffy Group-By-Attributes with the Aggregation Operator"
Legacy User
New Altair Community Member
Hi,
unfortunately I'm not able to count an attribute by a group. What I want to do is:
1. I load a model
2. Apply the data set (discrete label)
3. try to count for each group of the label the model outcome
I always get an error that my specified group_by_attributes (= flower_type) does not exist.
(flower_type is the label)
Do I have to change the Role of the attribute via ChangeAttributeRole? I tried it already but I does not work
Here the correspondng xml-file:
<operator name="Teststichprobe" class="ExcelExampleSource">
<parameter key="decimal_point_character" value=","/>
<parameter key="excel_file" value="\\Swbfs002\Informationssysteme\Berichtswesen\Aufgaben\Schulungen\RapidMiner\Beispiele\iris_teststichprobe.xls"/>
<parameter key="first_row_as_names" value="true"/>
<parameter key="id_column" value="6"/>
<parameter key="label_column" value="5"/>
</operator>
<operator name="ModelLoader" class="ModelLoader">
<parameter key="model_file" value="\\Swbfs002\Informationssysteme\Berichtswesen\Aufgaben\Schulungen\RapidMiner\Beispiele\model_dt_iris.mod"/>
</operator>
<operator name="ModelApplier" class="ModelApplier">
<list key="application_parameters">
<parameter key="sum(flower_types)" value="flower types"/>
</list>
</operator>
<operator name="Aggregation" class="Aggregation">
<list key="aggregation_attributes">
<parameter key="prediction(flower_type)" value="count"/>
</list>
<parameter key="group_by_attributes" value="flower_type"/>
</operator>
</operator>
Cheers
Thomas
unfortunately I'm not able to count an attribute by a group. What I want to do is:
1. I load a model
2. Apply the data set (discrete label)
3. try to count for each group of the label the model outcome
I always get an error that my specified group_by_attributes (= flower_type) does not exist.
(flower_type is the label)
Do I have to change the Role of the attribute via ChangeAttributeRole? I tried it already but I does not work
Here the correspondng xml-file:
<operator name="Teststichprobe" class="ExcelExampleSource">
<parameter key="decimal_point_character" value=","/>
<parameter key="excel_file" value="\\Swbfs002\Informationssysteme\Berichtswesen\Aufgaben\Schulungen\RapidMiner\Beispiele\iris_teststichprobe.xls"/>
<parameter key="first_row_as_names" value="true"/>
<parameter key="id_column" value="6"/>
<parameter key="label_column" value="5"/>
</operator>
<operator name="ModelLoader" class="ModelLoader">
<parameter key="model_file" value="\\Swbfs002\Informationssysteme\Berichtswesen\Aufgaben\Schulungen\RapidMiner\Beispiele\model_dt_iris.mod"/>
</operator>
<operator name="ModelApplier" class="ModelApplier">
<list key="application_parameters">
<parameter key="sum(flower_types)" value="flower types"/>
</list>
</operator>
<operator name="Aggregation" class="Aggregation">
<list key="aggregation_attributes">
<parameter key="prediction(flower_type)" value="count"/>
</list>
<parameter key="group_by_attributes" value="flower_type"/>
</operator>
</operator>
Cheers
Thomas
0
Answers
-
Hi Guys,
I fixed it wih an appropriate Performance-Operator (Anyway, I would like to know how to solve my explained problem above.
Cheers
Thomas0 -
Hi Thomas,
probably the "flower_type" attribute was still set to a special role (label) and was hence not found by the aggregation. Here is an example:
<operator name="Root" class="Process" expanded="yes">
<operator name="ExampleSource" class="ExampleSource">
<parameter key="attributes" value="C:\Dokumente und Einstellungen\Mierswa\Eigene Dateien\rm_workspace\sample\data\iris.aml"/>
</operator>
<operator name="NaiveBayes" class="NaiveBayes">
<parameter key="keep_example_set" value="true"/>
</operator>
<operator name="ModelApplier" class="ModelApplier">
<list key="application_parameters">
</list>
</operator>
<operator name="ChangeAttributeRole" class="ChangeAttributeRole">
<parameter key="name" value="label"/>
</operator>
<operator name="ChangeAttributeRole (2)" class="ChangeAttributeRole" activated="no">
<parameter key="name" value="prediction(label)"/>
</operator>
<operator name="Aggregation" class="Aggregation">
<list key="aggregation_attributes">
<parameter key="prediction(label)" value="count"/>
</list>
<parameter key="group_by_attributes" value="label"/>
</operator>
</operator>
Cheers,
Ingo0