Rapidminer 的运行时提示

发布于 2024-10-07 21:41:58 字数 192 浏览 3 评论 0原文

我一直在使用 Rapidminer 并创建了一系列执行一组标准任务的流程。现在,我希望允许用户在开始时动态设置进程的参数。

例如,在编写 CSV 时,我想提示用户输入一个字符串,其中包含应通过某些提示保存该文件的位置(在脚本开始时或在过程中的某个其他阶段)。

这可能吗通过Rapidminer,或者我应该创建一些脚本来动态生成和运行进程?

I have been using Rapidminer and created a series of processes which preform a standard set of tasks. Now, I want allow the user to dynamically set the parameters of a process at the start.

For example, when writing a CSV, I want to prompt the user to type a string containing the location where it should be saved via some prompt (either at the start of the script, or at some other stage during the process.

Is this possible via Rapidminer, or should I be creating some script to generate and runt he process on the fly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦亿 2024-10-14 21:41:58

要更改要传递给流程的参数,我相信您必须编辑流程的 .xml 文件。例如,

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.0">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.0.10" expanded="true" name="Process">
    <process expanded="true" height="145" width="212">
      <operator activated="true" class="generate_data" compatibility="5.0.10" expanded="true" height="60" name="Generate Data" width="90" x="112" y="30">
        <parameter key="number_examples" value="10"/>
      </operator>
      <operator activated="true" class="write_csv" compatibility="5.0.10" expanded="true" height="60" name="Write CSV" width="90" x="271" y="39">
        <parameter key="csv_file" value="C:\Users\wessel\Desktop\gendata.csv"/>
      </operator>
      <connect from_op="Generate Data" from_port="output" to_op="Write CSV" to_port="input"/>
      <connect from_op="Write CSV" from_port="through" 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"/>
    </process>
  </operator>
</process>

您可以看到,对于 write_csv 运算符,该值包含要写入的文件的路径。按照您的描述更改参数需要编写一个脚本来从用户处获取值,将 .xml 文件中的相应值编辑为这些所需的值,然后将该过程交给 RapidMiner。

To change the parameters you want passed to your processes, I believe that you must edit the .xml file of your process. For example,

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.0">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.0.10" expanded="true" name="Process">
    <process expanded="true" height="145" width="212">
      <operator activated="true" class="generate_data" compatibility="5.0.10" expanded="true" height="60" name="Generate Data" width="90" x="112" y="30">
        <parameter key="number_examples" value="10"/>
      </operator>
      <operator activated="true" class="write_csv" compatibility="5.0.10" expanded="true" height="60" name="Write CSV" width="90" x="271" y="39">
        <parameter key="csv_file" value="C:\Users\wessel\Desktop\gendata.csv"/>
      </operator>
      <connect from_op="Generate Data" from_port="output" to_op="Write CSV" to_port="input"/>
      <connect from_op="Write CSV" from_port="through" 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"/>
    </process>
  </operator>
</process>

You can see that for the write_csv operator, the value contains the path of the file to be written to. Changing the parameters as you describe would involve writing a script to get the values from the user, edit the corresponding values in the .xml file to these desired values and then throwing the process at RapidMiner.

握住我的手 2024-10-14 21:41:58

可以创建一个允许用户在运行时输入提示的 Groovy 脚本。这避免了每次都必须编辑流程。

这是一个示例,基于原文来自RapidMiner论坛。

It's possible to create a Groovy script that will allow a user to enter prompts at run time. This avoids having to edit the process each time.

Here is an example based on an original from the RapidMiner forum.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文