【问题标题】:RapidMiner Multiple Filters in sequenceRapidMiner 按顺序排列多个过滤器
【发布时间】:2013-03-04 20:59:13
【问题描述】:

我是 RapidMiner 的新手...我想做的是我有一个包含 10 个文档的列表,我使用 ProcessDocuments 运算符(子任务)对其进行标记-> 标记...结果是 10由 800 个 示例集组成,包含 10 行(每个文档一个)和 800 个属性(每个标记一个)。

现在我想按长度过滤 800 个标记,我再次使用 ProcessDocuments 运算符(子任务)-> FilterByLength 在上一个 ProcessDocuments 运算符生成的世界列表上...结果是 800 x 700 matrix...800 表示来自先前 ProcessDocuments Operator 的 800 个标记和 700 个减少的标记集。

我想要完成的是一个 10 x 700 示例集,我可以将其传递给 Kmeans 聚类算子。我该怎么做?

谢谢

【问题讨论】:

    标签: rapidminer


    【解决方案1】:

    我不确定您为什么要使用两个“处理文档”运算符,因为您可以在第一个运算符中添加“标记化”和“过滤令牌(按长度)”,这应该会产生您需要的内容。

    这是一个小例子。

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.005">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.3.005" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="text:create_document" compatibility="5.3.000" expanded="true" height="60" name="Create Document" width="90" x="45" y="75">
            <parameter key="text" value="This is a test with a looooooooooong word"/>
          </operator>
          <operator activated="true" class="text:create_document" compatibility="5.3.000" expanded="true" height="60" name="Create Document (2)" width="90" x="45" y="165">
            <parameter key="text" value="Again a text which has anoooooooooooooother long word."/>
          </operator>
          <operator activated="true" class="text:process_documents" compatibility="5.3.000" expanded="true" height="112" name="Process Documents" width="90" x="313" y="75">
            <process expanded="true">
              <operator activated="true" class="text:tokenize" compatibility="5.3.000" expanded="true" height="60" name="Tokenize" width="90" x="45" y="30"/>
              <operator activated="true" class="text:filter_by_length" compatibility="5.3.000" expanded="true" height="60" name="Filter Tokens (by Length)" width="90" x="179" y="30">
                <parameter key="max_chars" value="10"/>
              </operator>
              <connect from_port="document" to_op="Tokenize" to_port="document"/>
              <connect from_op="Tokenize" from_port="document" to_op="Filter Tokens (by Length)" to_port="document"/>
              <connect from_op="Filter Tokens (by Length)" 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.3.005" expanded="true" height="76" name="Clustering" width="90" x="447" y="75"/>
          <connect from_op="Create Document" from_port="output" to_op="Process Documents" to_port="documents 1"/>
          <connect from_op="Create Document (2)" from_port="output" to_op="Process Documents" to_port="documents 2"/>
          <connect from_op="Process Documents" from_port="example set" 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"/>
        </process>
      </operator>
    </process>
    

    【讨论】:

    • 嗨,maerch,我就是这样做的,但我只是想知道我提出的方式是否可行,即我使用两个流程文档....
    【解决方案2】:

    我倾向于同意已经提供的答案;看起来它可以解决问题,但是您可以执行以下操作。

    • 使用 WordList to Data 运算符将 800 字列表转换为示例集。
    • 使用 Nominal to Text 运算符将多项式单词属性的类型更改为文本。
    • 对文本属性使用 Process Documents from Data 运算符并在其中按长度过滤。

    我做了一些有点相似的东西here

    700 字的限制很难控制。在我看来,按长度排序的单词列表不太可能在 700 处方便地截断。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-01
      • 2012-12-05
      相关资源
      最近更新 更多