Pages: [1]
  Print  
Author Topic: Set Role Operator as document Name [Solved]  (Read 2185 times)
waelyafooz
Newbie
*
Posts: 10


« on: September 26, 2013, 04:32:57 PM »

Hi to all,
I used the rapidMiner for clustering purpose, i used K-mean.

My question is how can i know the documents which cluster inside cluster one and which cluster in cluster 2 and so on . Because i need to

calculate the quality of data clusters (using the F-meausre and Entropy).

FYI. my collection of documents around 1000 textual document . These documents named from A1 to  A1000. How can i know the document which clustered in each cluster?

Is the any example of how can i used the SET ROLE OPERATOR to set the document name as column after cluster process?
my regards

Wael.
« Last Edit: November 09, 2013, 05:21:08 AM by waelyafooz » Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #1 on: September 30, 2013, 08:58:36 AM »

Hi Wael,

use the set Role operator before the clustering operator to define the column that contains the document names as id.

Best regards,
Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
waelyafooz
Newbie
*
Posts: 10


« Reply #2 on: October 05, 2013, 04:45:02 PM »

Many thanks for you Marius,
Yes i used the Set Role  Operator before clustering, Then there are two attributes for ROLE OPERATOR are name and target role , So in name i select metadata_file while in target role i select id. unfortunately the document name not appear in the results.
my regards
WAEL
Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #3 on: October 09, 2013, 10:35:34 AM »

Can you please post your process setup as described in the link in my signature?

Best regards,
Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
waelyafooz
Newbie
*
Posts: 10


« Reply #4 on: October 13, 2013, 07:35:17 AM »

Many thanks for you Marius :

My steps as following

1) Process documents from Files  and inside it Tokenize 
2) Set Role Operator
3) Clustering operator (Kmean).

FYI: the set Role operator before the clustering and after the Process Document from files

Code:
  <?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="296" width="503">
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.000" expanded="true" height="76" name="Process Documents from Files" width="90" x="45" y="210">
        <list key="text_directories">
          <parameter key="mydata" value="D:\Classic_subset\ready"/>
        </list>
        <process expanded="true" height="586" width="559">
          <operator activated="true" class="text:tokenize" compatibility="5.3.000" expanded="true" height="60" name="Tokenize" width="90" x="234" y="30"/>
          <connect from_port="document" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="set_role" compatibility="5.2.008" expanded="true" height="76" name="Set Role" width="90" x="112" y="75">
        <list key="set_additional_roles">
          <parameter key="metadata_file" value="id"/>
        </list>
      </operator>
      <operator activated="true" class="k_means" compatibility="5.2.008" expanded="true" height="76" name="Clustering" width="90" x="246" y="30"/>
      <connect from_op="Process Documents from Files" from_port="example set" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Process Documents from Files" from_port="word list" to_port="result 1"/>
      <connect from_op="Set Role" from_port="example set output" to_op="Clustering" to_port="example set"/>
      <connect from_op="Clustering" from_port="cluster model" to_port="result 2"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
    </process>
  </operator>
</process>

my regards
Wael
Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #5 on: October 14, 2013, 11:03:50 AM »

Wael,

you have connected only the cluster model to the process output, but not the clustered data. Try connecting the second output of k-Means to the process output to create the expected result.

Best regards,
Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
waelyafooz
Newbie
*
Posts: 10


« Reply #6 on: October 16, 2013, 09:44:41 AM »

Many thanks for yoy Marius,
Also same problem the out put without the file name

Code:
<?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="386" width="681">
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.001" expanded="true" height="76" name="Process Documents from Files" width="90" x="45" y="255">
        <list key="text_directories">
          <parameter key="ssssss" value="F:\dataset"/>
        </list>
        <process expanded="true" height="519" width="806">
          <operator activated="true" class="text:tokenize" compatibility="5.3.001" expanded="true" height="60" name="Tokenize" width="90" x="358" y="30"/>
          <connect from_port="document" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="k_means" compatibility="5.2.008" expanded="true" height="76" name="Clustering" width="90" x="112" y="75"/>
      <operator activated="true" class="set_role" compatibility="5.2.008" expanded="true" height="76" name="Set Role" width="90" x="246" y="30">
        <parameter key="name" value="metadata_file"/>
        <parameter key="target_role" value="id"/>
        <list key="set_additional_roles">
          <parameter key="metadata_file" value="id"/>
        </list>
      </operator>
      <connect from_op="Process Documents from Files" from_port="example set" to_op="Clustering" to_port="example set"/>
      <connect from_op="Process Documents from Files" from_port="word list" to_port="result 1"/>
      <connect from_op="Clustering" from_port="clustered set" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Set Role" from_port="example set output" to_port="result 2"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="90"/>
    </process>
  </operator>
</process>
 
Logged
waelyafooz
Newbie
*
Posts: 10


« Reply #7 on: October 16, 2013, 09:50:55 AM »

I do like the follwing:

Many thanks for you Marius :

My steps as following

1) Process documents from Files  and inside it Tokenize  
2) Set Role Operator
3) Clustering operator (Kmean).

Or

Many thanks for you Marius :

My steps as following

1) Process documents from Files  and inside it Tokenize  
2)  Clustering operator (Kmean).
3) Set Role Operator .

Please have a look to this :
Code:
<?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="386" width="681">
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.001" expanded="true" height="76" name="Process Documents from Files" width="90" x="45" y="210">
        <list key="text_directories">
          <parameter key="ssssss" value="F:\dataset"/>
        </list>
        <process expanded="true" height="519" width="806">
          <operator activated="true" class="text:tokenize" compatibility="5.3.001" expanded="true" height="60" name="Tokenize" width="90" x="358" y="30"/>
          <connect from_port="document" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="set_role" compatibility="5.2.008" expanded="true" height="76" name="Set Role" width="90" x="179" y="75">
        <parameter key="name" value="metadata_file"/>
        <parameter key="target_role" value="id"/>
        <list key="set_additional_roles">
          <parameter key="metadata_file" value="id"/>
        </list>
      </operator>
      <operator activated="true" class="k_means" compatibility="5.2.008" expanded="true" height="76" name="Clustering" width="90" x="313" y="75"/>
      <connect from_op="Process Documents from Files" from_port="example set" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Process Documents from Files" from_port="word list" to_port="result 1"/>
      <connect from_op="Set Role" from_port="example set output" to_op="Clustering" to_port="example set"/>
      <connect from_op="Clustering" from_port="cluster model" to_port="result 2"/>
      <connect from_op="Clustering" from_port="clustered set" to_port="result 3"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
      <portSpacing port="sink_result 4" spacing="0"/>
    </process>
  </operator>
</process>

Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #8 on: October 18, 2013, 02:24:25 PM »

Wael,

what's the problem with the process you posted? What do you want to do? Why are you using the Set Role operator?

By the way, you are using RapidMiner 5.2.8, which is more than a year old, please update to the latest version 5.3.13.

Best regards,
Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
waelyafooz
Newbie
*
Posts: 10


« Reply #9 on: October 19, 2013, 04:29:37 PM »

Hi marius,
Yes, i already upgrade my version now.

I want to show the document name in the cluster .
for example using the K-mean, i produce 5 clusters based , i want to know which document inside which cluster.
for example :
I have document a , b, c , d and so on , if the document b and c in one cluster just show me the name of documents as attribute.

if you ask me Why i need that ?
i need to calculate the f-measure based on my data set.

my regards
Wael.
Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #10 on: October 21, 2013, 03:37:02 PM »

Hi Wael,

but the output of the process setup posted above already contains both the cluster in one column and the filename in another column. I just checked it with the latest version of RapidMiner. Do you have a different output?

Best regards,
Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
waelyafooz
Newbie
*
Posts: 10


« Reply #11 on: November 09, 2013, 05:18:01 AM »

Many thanks for you Mr.Marius for you help .... Yes  already done . Thanks alot ..
have alook to this
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.013">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.000" expanded="true" height="76" name="Process Documents from Files" width="90" x="45" y="210">
        <list key="text_directories">
          <parameter key="oo" value="D:\Classic_subset\test"/>   

        </list>
        <process expanded="true">
          <operator activated="true" class="text:tokenize" compatibility="5.3.000" expanded="true" height="60" name="Tokenize" width="90" x="234" y="30"/>
          <connect from_port="document" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="76" name="Set Role" width="90" x="112" y="75">
        <parameter key="attribute_name" value="metadata_file"/>
        <parameter key="target_role" value="id"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="k_means" compatibility="5.3.013" expanded="true" height="76" name="Clustering" width="90" x="246" y="30">
        <parameter key="max_runs" value="1"/>
        <parameter key="max_optimization_steps" value="1"/>
      </operator>
      <connect from_op="Process Documents from Files" from_port="example set" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Process Documents from Files" from_port="word list" to_port="result 2"/>
      <connect from_op="Set Role" from_port="example set output" to_op="Clustering" to_port="example set"/>
      <connect from_op="Clustering" from_port="cluster model" 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"/>
      <portSpacing port="sink_result 3" spacing="0"/>
    </process>
  </operator>
</process>

Logged
Pages: [1]
  Print  
 
Jump to: