clustering

sali
sali New Altair Community Member
edited November 5 in Community Q&A
Hi every body,

i want to apply the clustering kmean on a data sets  , and i set the nombre of cluseters to 2, and normaly i will have two distinct colors in the plotting, but i find more than two coulors, how to ajust this for a correct results?

Tagged:

Answers

  • haddock
    haddock New Altair Community Member

    Bienvenu Sali!

    I'm not sure I understand what exactly you're in need of, so here is an example to focus on. I make two clusters on the Iris dataset, and apply that model to label the dataset, which you can then plot in an almost infinite number of ways..
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" expanded="true" name="Root">
        <description></description>
        <parameter key="logverbosity" value="warning"/>
        <process expanded="true" height="335" width="413">
          <operator activated="true" class="retrieve" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
            <parameter key="repository_entry" value="//Samples/data/Iris"/>
          </operator>
          <operator activated="true" class="multiply" expanded="true" height="94" name="Multiply" width="90" x="179" y="30"/>
          <operator activated="true" class="k_means" expanded="true" height="76" name="KMeans" width="90" x="313" y="165">
            <parameter key="add_as_label" value="true"/>
          </operator>
          <operator activated="true" class="apply_model" expanded="true" height="76" name="Apply Model" width="90" x="484" y="163">
            <list key="application_parameters"/>
          </operator>
          <connect from_op="Retrieve" from_port="output" to_op="Multiply" to_port="input"/>
          <connect from_op="Multiply" from_port="output 1" to_op="KMeans" to_port="example set"/>
          <connect from_op="Multiply" from_port="output 2" to_op="Apply Model" to_port="unlabelled data"/>
          <connect from_op="KMeans" from_port="cluster model" to_op="Apply Model" to_port="model"/>
          <connect from_op="Apply Model" from_port="labelled data" to_port="result 2"/>
          <connect from_op="Apply Model" from_port="model" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="108"/>
          <portSpacing port="sink_result 2" spacing="0"/>
          <portSpacing port="sink_result 3" spacing="18"/>
        </process>
      </operator>
    </process>
    Let me know where exactly you need assistance, and I'll try to help.

    There are no tutorials in French, so we have to let the code do the talking!

    A bientot