Interrupt process and prompt user for input
inde
New Altair Community Member
Hi,
I'm evaluating Rapidminer regarding interactive ETL abilty and if all requirements are fulfilled plan on developing an extension.
Just two brief questions:
1. Is it possible to interrupt the running process from within an extension and prompt the user for input?
2. How broad are the capabilites of designing such a prompt? Am I free to use any GUI element and hence build some kind of Wizard that pops up during the process, enabling me to modify data and even parameters for the use in subsequent operators during process runtime? Or is this a contradiction to the XML based process definition paradigma?
Thanks a lot for any responses in advance!
Best regards
I'm evaluating Rapidminer regarding interactive ETL abilty and if all requirements are fulfilled plan on developing an extension.
Just two brief questions:
1. Is it possible to interrupt the running process from within an extension and prompt the user for input?
2. How broad are the capabilites of designing such a prompt? Am I free to use any GUI element and hence build some kind of Wizard that pops up during the process, enabling me to modify data and even parameters for the use in subsequent operators during process runtime? Or is this a contradiction to the XML based process definition paradigma?
Thanks a lot for any responses in advance!
Best regards
0
Answers
-
Hi,
generally speaking, it is possible - with the "Execute Script" operator. However it is not advised because the process might be run somewhere where no GUI exists (RapidAnalytics Server or RapidMiner in headless mode).
See the following example which modifies the "Decision Tree" operator "minimal leaf size" parameter according to user input at runtime:
Regards,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.013">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve Iris" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Samples/data/Iris"/>
</operator>
<operator activated="true" class="execute_script" compatibility="5.3.013" expanded="true" height="76" name="Execute Script" width="90" x="179" y="30">
<parameter key="script" value="import javax.swing.JOptionPane; import com.rapidminer.example.ExampleSet; import com.rapidminer.Process; import com.rapidminer.gui.RapidMinerGUI; import com.rapidminer.operator.learner.tree.DecisionTreeLearner; ExampleSet exampleSet = input[0]; String input = JOptionPane.showInputDialog("Input new minimal leaf size parameter for Decision Tree:"); Process process = RapidMinerGUI.getMainFrame().getProcess(); process.getOperator("Decision Tree").setParameter(DecisionTreeLearner.PARAMETER_MINIMAL_LEAF_SIZE, input); return exampleSet;"/>
</operator>
<operator activated="true" class="decision_tree" compatibility="5.3.013" expanded="true" height="76" name="Decision Tree" width="90" x="313" y="30">
<parameter key="minimal_leaf_size" value="300"/>
</operator>
<connect from_op="Retrieve Iris" from_port="output" to_op="Execute Script" to_port="input 1"/>
<connect from_op="Execute Script" from_port="output 1" to_op="Decision Tree" to_port="training set"/>
<connect from_op="Decision Tree" 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"/>
</process>
</operator>
</process>
Marco0 -
Hi,
thanks a lot for your advise! So it may then be smarter to program a standalone GUI that uses the Rapidminer API to execute predefined and fixed processes, load data, fetch the process output, do some problem tailored conflict resolution stuff if required and initiate another Rapidminer process with the manipulated data / parameters. Am I right?
Bests
inde0 -
Hi,
indeed, that would be advisable. However in that case I am obliged to point out that RapidMiner is licensed under the AGPL 3. This means that your application must be licensed under the AGPL 3 as well. If that is not possible/desirable, you need to purchase an OEM license. You can contact us here for details.
Regards,
Marco0