rapidminer 中的属性不匹配

Attributes do not match in rapidminer

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

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

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

column1|column2|column3
data   |data   |data   

问题:这样正确吗?

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

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

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

但我仍然收到此错误。

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

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

为了说服您,您还可以使用 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.

中进一步提问,或 re-post