Rapidminer 在没有拆分模式的情况下拆分列?

Rapidminer split a column without split pattern?

我有一个 table,其中一列包含值 ANNI,其他行包含 ANNI 2343355。

我想拆分包含 ANNI 2343355 的单元格。

这就是我所拥有的:

这就是我想要的:

其实答案对我帮助很大,但现在我又遇到了一个问题。 that's my process now

但结果看起来像这样: result

我不知道我在哪里弄乱了你的代码,但如果你能下次再帮我,我将不胜感激。

您可以使用 Split 运算符根据正则表达式模式分隔字符串值。在您的示例中,一个简单的 \s 空白字符就足够了。之后你需要做一些 post-processing 来获得所需格式的所有内容。请参见下面的示例。您只需在 RapidMiner 进程 window.

中复制并粘贴 XML 片段

<?xml version="1.0" encoding="UTF-8"?><process version="9.0.000-BETA">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="9.0.000-BETA" expanded="true" name="Process">
<process expanded="true">
  <operator activated="true" class="subprocess" compatibility="9.0.000-BETA" expanded="true" height="82" name="Subprocess" width="90" x="112" y="34">
    <process expanded="true">
      <operator activated="true" class="generate_data_user_specification" compatibility="9.0.000-BETA" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="45" y="34">
        <list key="attribute_values">
          <parameter key="Name" value="&quot;ANNI 12345&quot;"/>
          <parameter key="Number" value="67890"/>
        </list>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="generate_data_user_specification" compatibility="9.0.000-BETA" expanded="true" height="68" name="Generate Data by User Specification (2)" width="90" x="45" y="136">
        <list key="attribute_values">
          <parameter key="Name" value="&quot;ANNI&quot;"/>
          <parameter key="Number" value="67890"/>
        </list>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="append" compatibility="9.0.000-BETA" expanded="true" height="103" name="Append" width="90" x="246" y="34"/>
      <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_port="out 1"/>
      <portSpacing port="source_in 1" spacing="0"/>
      <portSpacing port="sink_out 1" spacing="0"/>
      <portSpacing port="sink_out 2" spacing="0"/>
    </process>
    <description align="center" color="red" colored="true" width="126">Create sample data</description>
  </operator>
  <operator activated="true" class="split" compatibility="9.0.000-BETA" expanded="true" height="82" name="Split" width="90" x="313" y="34">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="Name"/>
    <parameter key="split_pattern" value="\s"/>
  </operator>
  <operator activated="true" class="rename" compatibility="9.0.000-BETA" expanded="true" height="82" name="Rename" width="90" x="514" y="34">
    <parameter key="old_name" value="Name_1"/>
    <parameter key="new_name" value="Name"/>
    <list key="rename_additional_attributes">
      <parameter key="Name_2" value="New Number"/>
    </list>
    <description align="center" color="purple" colored="true" width="126">Change the names of the two split attributes</description>
  </operator>
  <operator activated="true" class="parse_numbers" compatibility="9.0.000-BETA" expanded="true" height="82" name="Parse Numbers" width="90" x="648" y="34">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="New Number"/>
    <description align="center" color="purple" colored="true" width="126">Name was a string before, so we have to parse the &amp;quot;New Number&amp;quot; column</description>
  </operator>
  <operator activated="true" class="generate_attributes" compatibility="9.0.000-BETA" expanded="true" height="82" name="Generate Attributes" width="90" x="782" y="34">
    <list key="function_descriptions">
      <parameter key="New Number" value="if([New Number]==MISSING_NUMERIC, Number,[New Number])"/>
    </list>
  </operator>
  <connect from_op="Subprocess" from_port="out 1" to_op="Split" to_port="example set input"/>
  <connect from_op="Split" from_port="example set output" to_op="Rename" to_port="example set input"/>
  <connect from_op="Rename" from_port="example set output" to_op="Parse Numbers" to_port="example set input"/>
  <connect from_op="Parse Numbers" from_port="example set output" to_op="Generate Attributes" to_port="example set input"/>
  <connect from_op="Generate Attributes" 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"/>
  <description align="center" color="yellow" colored="false" height="107" resized="false" width="180" x="277" y="119">Split the &amp;quot;Name&amp;quot; column (called Attribute in RapidMiner) along the blank (whitespace symbol \s)</description>
  <description align="center" color="green" colored="true" height="149" resized="true" width="169" x="764" y="125">Replace the missing values in &amp;quot;New Number&amp;quot; (where the Name didn't have a number) with the value of the Number column</description>
</process>
</operator>
</process>