Options

User parameters

awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
edited November 2018 in Help
I have a process I want to supply parameters to at the point where I run it. Ideally, I want to be prompted to enter the parameters and these would then find their way into macros that are then used how I like.

I can't find a way to do this. Is there a way? If not then I suppose I could have this as a feature request.

regards,

Andrew

Answers

  • Options
    landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi Andrew,
    you can save a process as template. You can configure there, which parameters of the process needs to be specified when the process is loaded.
    Does this already solve your problem?

    Greetings,
      Sebastian
  • Options
    awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    Hello Sebastian,

    Your answer promises much but I can't make it do what I want.

    I can create a template ok (note I can't delete them by the way - small featurette) but I can't work out how to indicate in the subsequent use of the template that certain parameters should be prompted for requiiring entry from me after I press f11 to run the test.

    regards

    Andrew
  • Options
    landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi Andrew,
    you won't be asked before executing the process. As I said, you will be able to specify them when the process is loaded.
    There's no operator that will ask for input during execution and it's unlikely we will add one, since creating GUI components within operators is forbidden for server side execution.
    But you can use a small script operator with a one liner for solving the problem:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" expanded="true" name="Process">
        <process expanded="true" height="449" width="882">
          <operator activated="true" class="generate_data" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30"/>
          <operator activated="true" class="execute_script" expanded="true" height="76" name="Execute Script" width="90" x="246" y="30">
            <parameter key="script" value="import javax.swing.JOptionPane;&#13;&#10;&#13;&#10;operator.getProcess().getMacroHandler().addMacro(&quot;macro&quot;, JOptionPane.showInputDialog(&quot;Please enter value&quot;));&#13;&#10;return input;"/>
          </operator>
          <operator activated="true" breakpoints="after" class="discretize_by_bins" expanded="true" height="94" name="Discretize" width="90" x="648" y="30">
            <parameter key="number_of_bins" value="%{macro}"/>
            <parameter key="range_name_type" value="short"/>
          </operator>
          <connect from_op="Generate Data" from_port="output" to_op="Execute Script" to_port="input 1"/>
          <connect from_op="Execute Script" from_port="output 1" to_op="Discretize" to_port="example set input"/>
          <connect from_op="Discretize" from_port="example set output" 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>
    More informations about scripting and general extending RapidMiner can be found in the White Paper "How to extend RapidMiner 5.0" in our shop.

    Greetings,
      Sebastian
  • Options
    awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    Hello Sebastian,

    That's precisely what I want - thanks - I'm almost tempted to spend the €40  :)

    This will make a big difference to me as it will speed up the "think/try" cycle.

    regards,

    Andrew
Sign In or Register to comment.