🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

"How get term-document matrix for SVD?"

User: "B_"
New Altair Community Member
Updated by Jocelyn
When I use the ProcessDocument module it creates a document-term matrix. I need to create a term-document matrix to feed to SVD.  I.e.,
              doc1      doc2    doc3
term1
term2
term2

I placed WordListtoDocument after it and fed the output to SVD, but the output from WordListtoDocument doesn't have the correct format - SVD generates an error. 

This is representative of how I set up the ProcessDoc(word) ->(word) WordListtoDoc (example set) -> (example set)SVD  modules.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.0">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.0.0" expanded="true" name="Process">
    <process expanded="true" height="521" width="955">
      <operator activated="true" class="read_excel" compatibility="5.0.0" expanded="true" height="60" name="Read Excel" width="90" x="45" y="30">
        <parameter key="excel_file" value="R:\Data\restrvw_1.xls"/>
        <list key="annotations"/>
      </operator>
      <operator activated="true" class="replace" compatibility="5.0.0" expanded="true" height="76" name="Replace" width="90" x="45" y="120">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="Summary|Good|Bad"/>
        <parameter key="replace_what" value="car"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.0.0" expanded="true" height="76" name="Select Attributes" width="90" x="45" y="255">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="Summary|rowid|Rest_Type"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="5.0.0" expanded="true" height="76" name="Rest_type to label" width="90" x="179" y="165">
        <parameter key="name" value="Car_Type"/>
        <parameter key="target_role" value="label"/>
      </operator>
      <operator activated="true" class="text:process_document_from_data" compatibility="5.0.0" expanded="true" height="76" name="Process Documents from Data" width="90" x="246" y="30">
        <parameter key="create_word_vector" value="false"/>
        <parameter key="prune_method" value="absolute"/>
        <parameter key="prune_below_absolute" value="2"/>
        <parameter key="prune_above_absolute" value="100"/>
        <list key="specify_weights"/>
        <process expanded="true" height="526" width="806">
          <operator activated="true" class="text:transform_cases" compatibility="5.0.0" expanded="true" height="60" name="Transform Cases" width="90" x="45" y="75"/>
          <operator activated="true" class="text:tokenize" compatibility="5.0.0" expanded="true" height="60" name="Tokenize" width="90" x="246" y="75"/>
          <operator activated="true" class="text:filter_stopwords_english" compatibility="5.0.0" expanded="true" height="60" name="Filter Stopwords (English)" width="90" x="447" y="30"/>
          <connect from_port="document" to_op="Transform Cases" to_port="document"/>
          <connect from_op="Transform Cases" from_port="document" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_op="Filter Stopwords (English)" to_port="document"/>
          <connect from_op="Filter Stopwords (English)" 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="text:wordlist_to_data" compatibility="5.0.0" expanded="true" height="76" name="WordList to Data" width="90" x="447" y="30"/>
      <operator activated="true" class="singular_value_decomposition" compatibility="5.0.8" expanded="true" height="94" name="SVD" width="90" x="604" y="102"/>
      <connect from_op="Read Excel" from_port="output" to_op="Replace" to_port="example set input"/>
      <connect from_op="Replace" 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="Rest_type to label" to_port="example set input"/>
      <connect from_op="Rest_type to label" from_port="example set output" to_op="Process Documents from Data" to_port="word list"/>
      <connect from_op="Process Documents from Data" from_port="word list" to_op="WordList to Data" to_port="word list"/>
      <connect from_op="WordList to Data" from_port="example set" to_op="SVD" to_port="example set input"/>
      <connect from_op="SVD" 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"/>
    </process>
  </operator>
</process>
I also used the Transpose module after ProcessDocument but SVD did not accept the example set from Transpose.

ProcessDoc(example set) ->(example set) Transpose(example set) -> (example set)SVD

How should I set this up?

TIA

Find more posts tagged with