Pages: [1]
  Print  
Author Topic: special Transpose after processing documents from text processing  (Read 1210 times)
virgila
Newbie
*
Posts: 1


« on: October 15, 2013, 03:55:26 PM »

Hello Miners. I have a basic problem easy in the head but complicated to do for a new person on rapid miner.
I did processing documents on excel file and I obtain this kind of exemple set:

file1file2
word101
word210

But Now I want to obtain a table like this:
wordsfiles
word1File2
word2file1

Adn I don't know how. Please Help
Logged
awchisholm
Sr. Member
****
Posts: 390


WWW
« Reply #1 on: October 15, 2013, 08:33:43 PM »

Hello virgila,

De-Pivot is a possible solution. A bit mind-numbing; I find trial and error is the only way to get it to work.

Here's an example for you to trial and error with.

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="generate_data_user_specification" compatibility="5.3.013" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="45" y="30">
        <list key="attribute_values">
          <parameter key="file1" value="0"/>
          <parameter key="file2" value="1"/>
          <parameter key="word" value="&quot;word1&quot;"/>
        </list>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="generate_data_user_specification" compatibility="5.3.013" expanded="true" height="60" name="Generate Data by User Specification (2)" width="90" x="45" y="120">
        <list key="attribute_values">
          <parameter key="file1" value="1"/>
          <parameter key="file2" value="0"/>
          <parameter key="word" value="&quot;word2&quot;"/>
        </list>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="append" compatibility="5.3.013" expanded="true" height="94" name="Append" width="90" x="179" y="30"/>
      <operator activated="true" class="de_pivot" compatibility="5.3.013" expanded="true" height="76" name="De-Pivot" width="90" x="313" y="30">
        <list key="attribute_name">
          <parameter key="count" value="file.*"/>
        </list>
        <parameter key="index_attribute" value="label1"/>
        <parameter key="create_nominal_index" value="true"/>
      </operator>
      <operator activated="true" class="filter_examples" compatibility="5.3.013" expanded="true" height="76" name="Filter Examples" width="90" x="313" y="120">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="count=0"/>
        <parameter key="invert_filter" value="true"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.3.013" expanded="true" height="76" name="Select Attributes" width="90" x="447" y="120">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="|count"/>
        <parameter key="invert_selection" value="true"/>
      </operator>
      <operator activated="true" class="rename" compatibility="5.3.013" expanded="true" height="76" name="Rename" width="90" x="581" y="120">
        <parameter key="old_name" value="label1"/>
        <parameter key="new_name" value="files"/>
        <list key="rename_additional_attributes">
          <parameter key="word" value="words"/>
        </list>
      </operator>
      <connect from_op="Generate Data by User Specification" from_port="output" to_op="Append" to_port="example set 1"/>
      <connect from_op="Generate Data by User Specification (2)" from_port="output" to_op="Append" to_port="example set 2"/>
      <connect from_op="Append" from_port="merged set" to_op="De-Pivot" to_port="example set input"/>
      <connect from_op="De-Pivot" from_port="example set output" to_op="Filter Examples" to_port="example set input"/>
      <connect from_op="De-Pivot" from_port="original" to_port="result 2"/>
      <connect from_op="Filter Examples" 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="Rename" to_port="example set input"/>
      <connect from_op="Rename" from_port="example set output" 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>

regards

Andrew
Logged

Pages: [1]
  Print  
 
Jump to: