如何将快速矿工中的“自动模型”保存到本地磁盘

时间:2018-11-05 11:01:36

标签: rapidminer

我已经使用Rapid Miner建立了回归模型。对模型进行微调后,精度会很高。现在,我想使用相同的Model文件在下一组数据上运行。有什么方法可以将RapidMiner分类器模型导出到本地磁盘并预测新数据。

1 个答案:

答案 0 :(得分:1)

要访问AutoModel结果,请在结果视图中单击“打开过程”。然后,您可以右键单击第三个输出端口(用于模型)或重新运行该过程,然后通过右键单击“模型”选项卡标题来存储模型。

通常,您可以将任何模型存储在RapidMiner存储库中。右键单击结果视图中的选项卡标题,或者在模型输出端口之后使用“ Store” 运算符。

如果随后要对新数据运行模型,请使用“应用模型” 运算符以及已存储的模型和新数据集。

有关示例,请参见教程过程(只需将XML复制并粘贴到您的过程窗口中)。 您还可以查看RapidMiner社区以获取更多培训材料:
 https://community.rapidminer.com/t5/Machine-Learning-Essentials-K-nn/tkb-p/IntroductoryML

Apply Model tutorial process

<?xml version="1.0" encoding="UTF-8"?><process version="9.0.003">
 <context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process" origin="GENERATED_TUTORIAL">
<process expanded="true">
  <operator activated="true" class="retrieve" compatibility="9.0.003" expanded="true" height="68" name="Retrieve Polynomial" origin="GENERATED_TUTORIAL" width="90" x="112" y="85">
    <parameter key="repository_entry" value="//Samples/data/Polynomial"/>
  </operator>
  <operator activated="true" class="split_data" compatibility="9.0.003" expanded="true" height="103" name="Split Data" origin="GENERATED_TUTORIAL" width="90" x="246" y="85">
    <enumeration key="partitions">
      <parameter key="ratio" value="0.8"/>
      <parameter key="ratio" value="0.2"/>
    </enumeration>
  </operator>
  <operator activated="true" class="select_attributes" compatibility="9.0.003" expanded="true" height="82" name="Select Attributes" origin="GENERATED_TUTORIAL" width="90" x="447" y="289">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="label"/>
    <parameter key="invert_selection" value="true"/>
    <parameter key="include_special_attributes" value="true"/>
  </operator>
  <operator activated="true" class="linear_regression" compatibility="9.0.003" expanded="true" height="103" name="Linear Regression" origin="GENERATED_TUTORIAL" width="90" x="447" y="85"/>
  <operator activated="true" class="apply_model" compatibility="7.1.001" expanded="true" height="82" name="Apply Model" origin="GENERATED_TUTORIAL" width="90" x="715" y="187">
    <list key="application_parameters"/>
  </operator>
  <connect from_op="Retrieve Polynomial" from_port="output" to_op="Split Data" to_port="example set"/>
  <connect from_op="Split Data" from_port="partition 1" to_op="Linear Regression" to_port="training set"/>
  <connect from_op="Split Data" from_port="partition 2" to_op="Select Attributes" to_port="example set input"/>
  <connect from_op="Select Attributes" from_port="example set output" to_op="Apply Model" to_port="unlabelled data"/>
  <connect from_op="Linear Regression" from_port="model" to_op="Apply Model" to_port="model"/>
  <connect from_op="Apply Model" from_port="labelled data" to_port="result 2"/>
  <connect from_op="Apply Model" from_port="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"/>
  <portSpacing port="sink_result 3" spacing="0"/>
  <description align="center" color="green" colored="true" height="189" resized="true" width="210" x="391" y="23">Generating a model within the training of a linear regression</description>
  <description align="center" color="blue" colored="true" height="188" resized="true" width="309" x="74" y="23">Loading labelled data</description>
  <description align="center" color="purple" colored="true" height="187" resized="true" width="208" x="390" y="250">Unlabelled data&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Removing the label to emulate an unlabelled data set.</description>
  <description align="left" color="yellow" colored="false" height="305" resized="true" width="325" x="645" y="134">Applying the model obtained from training to an unlabelled data set&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Labelled data output:&lt;br&gt;ExampleSet from the unlabelled input port enriched with predictions obtained from applying the model.&lt;br&gt;Model output:&lt;br&gt;Have a look into the Results view showing the formula for linear regression with coefficients obtained from the training process.&lt;br&gt; 
 </description>
 </process>
 </operator>
 </process>