The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"protypes making by clustering"

m_r_nourm_r_nour Member Posts: 35 Maven
edited June 2019 in Help
Hi all

I want to use centers of clusters in each class  as new data to reduce number of the samples:

as far as I know I should make an iteration among classes and in each class make  a cluster and uses centers of clusters as a new sample.
but I do not know how? I made a draft code but I works just to filtering and clustering and it is not able to use and save them.


Regards
REZA

<operator name="Root" class="Process" expanded="yes">
    <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
        <parameter key="target_function" value="polynomial classification"/>
        <parameter key="number_examples" value="1000"/>
        <parameter key="number_of_attributes" value="20"/>
    </operator>
    <operator name="Normalization" class="Normalization">
        <parameter key="create_view" value="true"/>
    </operator>
    <operator name="protyper" class="OperatorChain" expanded="yes">
        <operator name="ValueIterator (2)" class="ValueIterator" expanded="yes">
            <parameter key="attribute" value="label"/>
            <operator name="ExampleFilter (3)" class="ExampleFilter">
                <parameter key="condition_class" value="attribute_value_filter"/>
                <parameter key="parameter_string" value="label = %{loop_value}"/>
            </operator>
            <operator name="KMeans" class="KMeans">
                <parameter key="keep_example_set" value="false"/>
                <parameter key="k" value="4"/>
            </operator>
            <operator name="ExceptionHandling" class="ExceptionHandling" expanded="yes">
                <operator name="ExampleSetMerge (2)" class="ExampleSetMerge">
                </operator>
            </operator>
        </operator>
        <operator name="IOConsumer (2)" class="IOConsumer" breakpoints="after">
            <parameter key="io_object" value="ClusterModel"/>
        </operator>
        <operator name="Final Retrieve (2)" class="IORetriever">
            <parameter key="name" value="Cluster Model"/>
            <parameter key="io_object" value="ClusterModel"/>
        </operator>
    </operator>
    <operator name="In every case: Store (2)" class="IOStorer">
        <parameter key="name" value="Cluster Model"/>
        <parameter key="io_object" value="ClusterModel"/>
    </operator>
</operator>
Tagged:

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    unfortunately this isn't possible with the current versions of RapidMiner. Might be, there will be an operator building an example set from a flat cluster model in 5.0.

    Greetings,
      Sebastian
  • haddockhaddock Member Posts: 849 Maven
    G'day,
    I want to use centers of clusters in each class  as new data to reduce number of the samples:
    An alternative would be to say that each label value is the name of a cluster, and that a protototype for a cluster would have for each attribute a value equal to the average for that attribute in that cluster. In that case you can do the following...
    <operator name="Root" class="Process" expanded="yes">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="simple non linear classification"/>
            <parameter key="number_of_attributes" value="10"/>
        </operator>
        <operator name="ValueIterator" class="ValueIterator" expanded="yes">
            <parameter key="attribute" value="label"/>
            <operator name="ExampleFilter" class="ExampleFilter">
                <parameter key="condition_class" value="attribute_value_filter"/>
                <parameter key="parameter_string" value="label=%{loop_value}"/>
            </operator>
            <operator name="FeatureNameFilter" class="FeatureNameFilter">
                <parameter key="filter_special_features" value="true"/>
                <parameter key="skip_features_with_name" value="label"/>
            </operator>
            <operator name="ExampleSetTranspose" class="ExampleSetTranspose">
            </operator>
            <operator name="AttributeAggregation" class="AttributeAggregation">
                <parameter key="attribute_name" value="Average_%{loop_value}"/>
                <parameter key="aggregation_attributes" value=".*"/>
                <parameter key="aggregation_function" value="average"/>
            </operator>
            <operator name="ExampleSetTranspose (2)" class="ExampleSetTranspose">
            </operator>
        </operator>
        <operator name="ExampleSetMerge" class="ExampleSetMerge">
        </operator>
        <operator name="ExampleFilter (2)" class="ExampleFilter">
            <parameter key="condition_class" value="attribute_value_filter"/>
            <parameter key="parameter_string" value="id=att.*"/>
            <parameter key="invert_filter" value="true"/>
        </operator>
    </operator>

Sign In or Register to comment.