RapidMiner - k-Medoids。确定medoid

时间:2016-05-17 15:14:31

标签: cluster-analysis rapidminer

我正在使用Rapid Miner来查看k-Medoids算法的一些结果和性能。我能够创建该方案并查看输出但我想在每个集群内部看到创建的中心点(选择的medoid)有没有办法做到这一点?

Img1:设计enter image description here

Img2:结果enter image description here

1 个答案:

答案 0 :(得分:0)

您可以使用Extract Cluster Prototypes运算符创建与群集质心对应的示例集。然后,您可以使用Append运算符将其连接到原始数据,尽管有一些工作要做以使示例集兼容。

这是一个例子

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="7.0.001">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="7.0.001" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="7.0.001" expanded="true" height="68" name="Retrieve Iris" width="90" x="45" y="34">
        <parameter key="repository_entry" value="//Samples/data/Iris"/>
      </operator>
      <operator activated="true" class="k_medoids" compatibility="7.0.001" expanded="true" height="82" name="Clustering" width="90" x="179" y="136">
        <parameter key="k" value="3"/>
      </operator>
      <operator activated="true" class="generate_attributes" compatibility="7.0.001" expanded="true" height="82" name="Generate Attributes" width="90" x="313" y="136">
        <list key="function_descriptions">
          <parameter key="type" value="&quot;data&quot;"/>
        </list>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="7.0.001" expanded="true" height="82" name="Select Attributes" width="90" x="447" y="136">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="label|id"/>
        <parameter key="invert_selection" value="true"/>
        <parameter key="include_special_attributes" value="true"/>
      </operator>
      <operator activated="true" class="extract_prototypes" compatibility="7.0.001" expanded="true" height="82" name="Extract Cluster Prototypes" width="90" x="313" y="34"/>
      <operator activated="true" class="generate_attributes" compatibility="7.0.001" expanded="true" height="82" name="Generate Attributes (2)" width="90" x="447" y="34">
        <list key="function_descriptions">
          <parameter key="type" value="&quot;centroid&quot;"/>
        </list>
      </operator>
      <operator activated="true" breakpoints="before" class="append" compatibility="7.0.001" expanded="true" height="103" name="Append" width="90" x="581" y="85"/>
      <connect from_op="Retrieve Iris" from_port="output" to_op="Clustering" to_port="example set"/>
      <connect from_op="Clustering" from_port="cluster model" to_op="Extract Cluster Prototypes" to_port="model"/>
      <connect from_op="Clustering" from_port="clustered set" to_op="Generate Attributes" to_port="example set input"/>
      <connect from_op="Generate Attributes" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
      <connect from_op="Select Attributes" from_port="example set output" to_op="Append" to_port="example set 2"/>
      <connect from_op="Extract Cluster Prototypes" from_port="example set" to_op="Generate Attributes (2)" to_port="example set input"/>
      <connect from_op="Generate Attributes (2)" from_port="example set output" to_op="Append" to_port="example set 1"/>
      <connect from_op="Append" from_port="merged 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"/>
    </process>
  </operator>
</process>

type属性可用作绘图中的颜色,以便您可以看到质心。