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
[Solved] Avoid empty clusters in Cluster Model
aryan_hosseinza
Member Posts: 74 Contributor II
Hi ,
I am clustering with means of K-means clustering (fast) , and after that I extract prototypes , but some of the prototypes belongs to empty clusters , so all of their values are missing , how can I remove these instances from my example set (or how can I avoid empty clusters ) ?
Thanks in advance ,
Arian
I am clustering with means of K-means clustering (fast) , and after that I extract prototypes , but some of the prototypes belongs to empty clusters , so all of their values are missing , how can I remove these instances from my example set (or how can I avoid empty clusters ) ?
Thanks in advance ,
Arian
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
<process expanded="true" height="640" width="2904">
<operator activated="true" class="retrieve" compatibility="5.2.008" expanded="true" height="60" name="Retrieve (3)" width="90" x="45" y="255">
<parameter key="repository_entry" value="descritized_MI_4"/>
</operator>
<operator activated="true" class="select_attributes" compatibility="5.2.008" expanded="true" height="76" name="Select Attributes" width="90" x="246" y="255">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="|id|discharge|admit"/>
<parameter key="invert_selection" value="true"/>
</operator>
<operator activated="true" class="sample_stratified" compatibility="5.2.008" expanded="true" height="76" name="Sample (2)" width="90" x="447" y="255">
<parameter key="sample" value="relative"/>
<parameter key="sample_ratio" value="0.01"/>
</operator>
<operator activated="true" class="nominal_to_numerical" compatibility="5.2.008" expanded="true" height="94" name="Nominal to Numerical" width="90" x="648" y="120">
<parameter key="attribute" value="sex"/>
<list key="comparison_groups"/>
</operator>
<operator activated="true" class="normalize" compatibility="5.2.008" expanded="true" height="94" name="Normalize" width="90" x="782" y="120"/>
<operator activated="true" class="multiply" compatibility="5.2.008" expanded="true" height="94" name="Multiply" width="90" x="1050" y="120"/>
<operator activated="true" class="filter_examples" compatibility="5.2.008" expanded="true" height="76" name="Filter Examples (4)" width="90" x="1251" y="300">
<parameter key="condition_class" value="attribute_value_filter"/>
<parameter key="parameter_string" value="event=t"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="5.2.008" expanded="true" height="60" name="Extract Macro" width="90" x="1452" y="300">
<parameter key="macro" value="k"/>
<parameter key="attribute_name" value="event"/>
</operator>
<operator activated="true" class="filter_examples" compatibility="5.2.008" expanded="true" height="76" name="Filter Examples" width="90" x="1251" y="30">
<parameter key="condition_class" value="attribute_value_filter"/>
<parameter key="parameter_string" value="event=f"/>
</operator>
<operator activated="true" class="multiply" compatibility="5.2.008" expanded="true" height="76" name="Multiply (2)" width="90" x="1452" y="165"/>
<operator activated="true" class="fast_k_means" compatibility="5.2.008" expanded="true" height="76" name="Clustering (3)" width="90" x="1586" y="165">
<parameter key="k" value="%{k}"/>
</operator>
<operator activated="true" class="extract_prototypes" compatibility="5.2.008" expanded="true" height="76" name="Extract Cluster Prototypes" width="90" x="1720" y="165"/>
<operator activated="true" class="select_attributes" compatibility="5.2.008" expanded="true" height="76" name="Select Attributes (2)" width="90" x="1921" y="165">
<parameter key="attribute_filter_type" value="single"/>
<parameter key="attribute" value="cluster"/>
<parameter key="invert_selection" value="true"/>
<parameter key="include_special_attributes" value="true"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="5.2.008" expanded="true" height="76" name="Generate Attributes" width="90" x="2055" y="165">
<list key="function_descriptions">
<parameter key="event" value=""f""/>
</list>
</operator>
<operator activated="true" class="numerical_to_binominal" compatibility="5.2.008" expanded="true" height="76" name="Numerical to Binominal" width="90" x="2189" y="165">
<parameter key="attribute_filter_type" value="single"/>
<parameter key="attribute" value="event"/>
</operator>
<operator activated="true" class="set_role" compatibility="5.2.008" expanded="true" height="76" name="Set Role (2)" width="90" x="2323" y="165">
<parameter key="name" value="event"/>
<parameter key="target_role" value="label"/>
<list key="set_additional_roles"/>
</operator>
<operator activated="false" class="shuffle" compatibility="5.2.008" expanded="true" height="76" name="Shuffle" width="90" x="2658" y="30"/>
<operator activated="true" class="multiply" compatibility="5.2.008" expanded="true" height="94" name="Multiply (3)" width="90" x="2524" y="165"/>
<operator activated="true" class="append" compatibility="5.2.008" expanded="true" height="94" name="Append" width="90" x="2725" y="345"/>
<connect from_op="Retrieve (3)" from_port="output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Sample (2)" to_port="example set input"/>
<connect from_op="Sample (2)" from_port="example set output" to_op="Nominal to Numerical" to_port="example set input"/>
<connect from_op="Nominal to Numerical" from_port="example set output" to_op="Normalize" to_port="example set input"/>
<connect from_op="Normalize" from_port="example set output" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Filter Examples" to_port="example set input"/>
<connect from_op="Multiply" from_port="output 2" to_op="Filter Examples (4)" to_port="example set input"/>
<connect from_op="Filter Examples (4)" from_port="example set output" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Extract Macro" from_port="example set" to_op="Append" to_port="example set 1"/>
<connect from_op="Filter Examples" from_port="example set output" to_op="Multiply (2)" to_port="input"/>
<connect from_op="Multiply (2)" from_port="output 1" to_op="Clustering (3)" to_port="example set"/>
<connect from_op="Clustering (3)" from_port="cluster model" to_op="Extract Cluster Prototypes" to_port="model"/>
<connect from_op="Extract Cluster Prototypes" from_port="example set" to_op="Select Attributes (2)" to_port="example set input"/>
<connect from_op="Select Attributes (2)" from_port="example set output" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Numerical to Binominal" to_port="example set input"/>
<connect from_op="Numerical to Binominal" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
<connect from_op="Set Role (2)" from_port="example set output" to_op="Multiply (3)" to_port="input"/>
<connect from_op="Multiply (3)" from_port="output 1" to_op="Append" to_port="example set 2"/>
<connect from_op="Multiply (3)" from_port="output 2" 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>
Tagged:
0
Answers
you can use Filter Examples to remove examples which contain missing attributes. Please see the attached process for a sample process.
Best, Marius