2013-03-04 161 views
0

我是RapidMiner的新手...我在做的是我有一个使用ProcessDocuments运算符(子任务) - > Tokenize ...进行标记的10个文档的列表...结果是一个10乘800具有10行(每个文档一个)和800个属性(每个令牌一个)的示例集。RapidMiner按顺序排列多个筛选器

现在我想filterbylength 800个令牌,我再次使用ProcessDocuments运营商(子任务) - > FilterByLength 由以前ProcessDocuments操作产生的worldlist ......结果是800 700矩阵... 800来自先前的ProcessDocuments操作者的800个令牌,并且700减少了令牌的集合。

我想完成的是10乘700个示例集,我可以将它传递给Kmeans聚类运算符。我怎样才能做到这一点?

感谢

回答

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> 
+0

喜maerch,多数民众赞成我是如何做到这一点,但我只是问了解方式我建议它可能或不可以,即我使用两个过程文件.... – 2013-03-06 17:33:15

0

我倾向于同意已经提供的答案;它看起来像解决了这个问题,但是你可以做如下的事情。

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

我做了大体相似here

东西的700字的限制将难以控制。在我看来,根据长度排序的单词列表将不太可能在700处具有方便的截止点。