首页 > 解决方案 > 如何将“自动模型”从快速矿工保存到本地磁盘

问题描述

我已经使用 Rapid Miner 建立了一个回归模型。微调模型后精度很好。现在我想使用相同的模型文件来运行下一组数据。有没有办法将 RapidMiner 分类器模型导出到本地磁盘并预测新数据。

标签: rapidminer

解决方案


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

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

如果您想在新数据上运行模型,请使用“应用模型”运算符,以及存储的模型和新数据集。

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

应用模型教程过程

<?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>

推荐阅读