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”的列/属性,其中每个示例的条目为 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 社区论坛中进一步提问或重新发布问题

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何检测和消除Rapidminer中的噪音?

ListView中的图像不匹配BackColor属性

RapidMiner:用另一个列/属性中的值替换Value

Rapidminer决策树结果

在Rapidminer中的Excel文件中查找单词

从RapidMiner Studio中的Execute Python处理器返回pandas DataFrame时发生ValueError

Rapidminer,如何拆分列?

Rapidminer:将标称属性转换为二项式属性的内存问题

textmining,在Rapidminer中导出群集

在RapidMiner Studio 6.1中设计集群结果

RapidMiner append to file

在Rapidminer中将性别属性值“男性/女性”替换为M / F

2倍于Rapidminer中“来自数据的处理文档”操作员的数据结果

测试示例集属性应等于OR或培训示例集Rapidminer SVM的超集

Rapidminer虚拟编码不匹配

RapidMiner中的拆分数据运算符始终生成相同的拆分

如何在RapidMiner中为关联规则加载交易(购物篮)数据?

RapidMiner:计算文档相似度

SVM导致Rapidminer的结果要比knime中的结果差得多

Rapidminer从拆分的属性生成新示例

在RapidMiner中处理文本时删除连字符(特殊字符)

在RapidMiner中创建Pareto图表

RapidMiner中的MongoDB聚合查询

在Rapidminer中对神经网络的输出进行约束

如何在 RapidMiner 中为关联规则挖掘准备事务数据集?

通过 Rapidminer 在单独的行中显示多值多项式值

Rapidminer 中的深度学习算法类型是什么?

在 Rapidminer 中导出结果

Rapidminer 中的逻辑回归最大似然