A program to recognize and reward our most engaged community members
Ingo Mierswa wrote:Option 2: a more automatic approach is to define a label attribute for each cluster distinguishing the current cluster from all others (e.g. with AttributeConstruction, change it to the label afterwards with ChangeAttributeRole). Now learn a weighting from this artificially labeled data (e.g. with Relief). Transform the weights into a data set with the AttributeWeights2ExampleSet operator and sort it according to the weight (Sorting). Keep only the k rows with highest weight (ExampleRangeFilter). Use macros (e.g. DataMacroDefinition) or any other means to retrieve the data from the data set and use the result again as base for the "Mapper" operator. Put everything in a loop (ValueIterator) and you get your generic and automatic result.Hope that helps. Cheers,Ingo
newstuff wrote:Error in: Sorting (Sorting) The attribute 'weights' does not exist. The example set does not contain an attribute with the given name.Where did I go wrong in configuring the Sorting operator?
newstuff wrote:<operator name="ExampleSet2AttributeWeights" class="ExampleSet2AttributeWeights"> </operator> <operator name="Sorting" class="Sorting" breakpoints="after"> <parameter key="attribute_name" value="Weights"/> <parameter key="sorting_direction" value="decreasing"/> </operator>Thoughts?
Tobias Malbrecht wrote:Yes of course: the attribute is called [tt]Weight[/tt] not [tt]Weights[/tt] ... without the "s"!
newstuff wrote:<operator name="ExampleSet2AttributeWeights" class="ExampleSet2AttributeWeights"> </operator> <operator name="Sorting" class="Sorting" breakpoints="after"> <parameter key="attribute_name" value="Weights"/> <parameter key="sorting_direction" value="decreasing"/> </operator>
Tobias Malbrecht wrote:ups, just read your post again and realized you did not use the [tt]AttributeWeights2ExampleSet[/tt] operator as Ingo suggested but the [tt]ExampleSet2AttributeWeights[/tt] operator. This of course makes the difference. So follow Ingo's suggestion, use a weighting scheme and the [tt]AttributeWeights2ExampleSet[/tt] operator. Then sort by the attribute [tt]Weight[/tt] and it should work.
newstuff wrote:I could not find an AttributeWeights2ExampleSet in RM4.3 so I used ExampleSet2AttributeWeights. Assuming that they are the same operator appears to be problematic. Will I find the AttributeWeights2ExampleSet in RM 4.3?
Ingo Mierswa wrote:the process looks fine until the text processing. Then things go wrong: What's the purpose of the ExampleSetGenerator here? Remove it.
Ingo Mierswa wrote: You added the attribute construction. But you forgot to define the necessary parameters. Create a new attribute with value "target" if the cluster attribute equals the target cluster and "non_target" otherwise. [
if (cluster=="cluster_0","target","non_target")
<operator name="Root" class="Process" expanded="yes"> <operator name="Create Data" class="OperatorChain" expanded="yes"> <operator name="ExampleSetGenerator" class="ExampleSetGenerator"> <parameter key="target_function" value="gaussian mixture clusters"/> <parameter key="number_examples" value="500"/> </operator> <operator name="AttributeFilter" class="AttributeFilter"> <parameter key="condition_class" value="attribute_name_filter"/> <parameter key="parameter_string" value="label"/> <parameter key="invert_filter" value="true"/> <parameter key="apply_on_special" value="true"/> </operator> </operator> <operator name="KMeans" class="KMeans"> <parameter key="k" value="3"/> </operator> <operator name="AttributeConstruction" class="AttributeConstruction"> <list key="function_descriptions"> <parameter key="label" value="if (cluster=="cluster_0","target","non_target")"/> </list> </operator> <operator name="ChangeAttributeRole" class="ChangeAttributeRole"> <parameter key="name" value="label"/> <parameter key="target_role" value="label"/> </operator> <operator name="Relief" class="Relief"> </operator> <operator name="AttributeWeights2ExampleSet" class="AttributeWeights2ExampleSet"> </operator> <operator name="Sorting" class="Sorting"> <parameter key="attribute_name" value="Weight"/> <parameter key="sorting_direction" value="decreasing"/> </operator></operator>