User parameters
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
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
Tagged:
0
Answers
-
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,
Sebastian0 -
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
Andrew0 -
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"?>
More informations about scripting and general extending RapidMiner can be found in the White Paper "How to extend RapidMiner 5.0" in our shop.
<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; operator.getProcess().getMacroHandler().addMacro("macro", JOptionPane.showInputDialog("Please enter value")); 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>
Greetings,
Sebastian0 -
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,
Andrew0