【问题标题】:Attributes do not match in rapidminerrapidminer 中的属性不匹配
【发布时间】:2018-05-20 08:34:24
【问题描述】:

我成功地将 rapidminer 中的神经网络算子应用于一个数据集,其中我有 3 列,第 4 列是标记的列

column1|column2|column3|column4(labelled)
data   |data   |data   |data  

,现在我有一个测试数据,以便根据column1、column2、column3预测标记列的值,测试数据如下:

column1|column2|column3
data   |data   |data   

问题:正确吗?

使用这种方法,我创建了一个模型,以便该过程可以预测 未标记 列的值:

然后,使用以下参考中的解决方案:

Split data solution

我再次使用拆分数据创建了一个模型,为此我组合了我的数据集以进行训练和测试(现在组合数据具有标记列的一些值,而有些则没有此列值,因为这是部分测试数据)。

但我仍然收到此错误。

【问题讨论】:

    标签: neural-network rapidminer


    【解决方案1】:

    据我所知,问题在于您没有将 Nominal to Numerical 运算符应用于您的测试集。 在默认设置中,此运算符为在指定属性中找到的每个标称值创建一个虚拟编码。在您的情况下,您将有一个名为“Course1=A”的列/属性,其中 1 作为原始列为“A”的每个示例的条目,依此类推。

    您需要对测试数据应用与训练数据相同的编码。 如您所见,Nominal to Numerical 运算符有一个额外的输出端口,称为 pre(预处理模型的缩写)。这可以用于对多个数据集应用相同的预处理步骤(如标准化或编码)。

    为了说服您,您还可以使用 Group Model 运算符将多个模型组合为一个。

    请参阅下面的流程 XML(只需将其 c&p 到 RapidMiner 的流程视图中)作为示例。

    <?xml version="1.0" encoding="UTF-8"?><process version="8.2.000">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="8.2.000" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="8.2.000" expanded="true" height="68" name="Retrieve Golf" width="90" x="45" y="34">
        <parameter key="repository_entry" value="//Samples/data/Golf"/>
      </operator>
      <operator activated="true" class="nominal_to_numerical" compatibility="8.2.000" expanded="true" height="103" name="Nominal to Numerical" width="90" x="179" y="34">
        <list key="comparison_groups"/>
        <description align="center" color="purple" colored="true" width="126">Transform the nominal attributes into a dummy encoding with 0/1 for each expression.&lt;br&gt;This encoding is then also delivered via &amp;quot;pre&amp;quot; output port.</description>
      </operator>
      <operator activated="true" class="neural_net" compatibility="8.2.000" expanded="true" height="82" name="Neural Net" width="90" x="447" y="34">
        <list key="hidden_layers"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="8.2.000" expanded="true" height="68" name="Retrieve Golf-Testset" width="90" x="45" y="340">
        <parameter key="repository_entry" value="//Samples/data/Golf-Testset"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="8.2.000" expanded="true" height="82" name="Apply Model (2)" width="90" x="447" y="340">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="apply_model" compatibility="8.2.000" expanded="true" height="82" name="Apply Model" width="90" x="648" y="340">
        <list key="application_parameters"/>
      </operator>
      <connect from_op="Retrieve Golf" from_port="output" to_op="Nominal to Numerical" to_port="example set input"/>
      <connect from_op="Nominal to Numerical" from_port="example set output" to_op="Neural Net" to_port="training set"/>
      <connect from_op="Nominal to Numerical" from_port="preprocessing model" to_op="Apply Model (2)" to_port="model"/>
      <connect from_op="Neural Net" from_port="model" to_op="Apply Model" to_port="model"/>
      <connect from_op="Retrieve Golf-Testset" from_port="output" to_op="Apply Model (2)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Apply Model" to_port="unlabelled data"/>
      <connect from_op="Apply Model" from_port="labelled data" 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="green" colored="true" height="103" resized="true" width="315" x="433" y="433">First apply the &amp;quot;preprocessing&amp;quot; model so the test data have the same structure&lt;br/&gt;&lt;br/&gt;Then apply the trained neural net</description>
    </process>
    </operator>
    </process>
    

    还可以随时在RapidMiner community forum 中进一步提问或重新发布问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-17
      • 2017-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多