"Process Run problem with Input and with Performance"
leno
New Altair Community Member
Hi i have build a process that read two model that i have prebuilded and apply this to an input set.
This process is run at every loop of a while cycle.
The performance are very poor and then i think of eliminate the read of the two model at every loop and i want to pass they with the input port.
What can i give to the process three input?
Every idea for have more performance?
Thank you
This process is run at every loop of a while cycle.
The performance are very poor and then i think of eliminate the read of the two model at every loop and i want to pass they with the input port.
What can i give to the process three input?
Every idea for have more performance?
Thank you
Tagged:
0
Answers
-
Are models read in every loop?
I believe Store and Retrieve operators migh help you with computational time demands.0 -
I think the problem is that i use the process class indeed using only an Operator everyone can help me?
I want only know how :
load a model (out of a loop)
apply same model (at every loop)
Thank you very much0 -
Ps i don't find it is possible store a model.0
-
Hi,
I must admit that I'm not quite sure what you want, however I suggest what I already suggested in the last dozen of threads or so about that topic in this forum:
Build your processes in RapidMiner so you can execute them from RapidMiner without any errors, then you can execute easily via java. Trying to create a process directly via java code requires extensive knowledge of the RapidMiner API and is a bit tedious. But if you're using the method I suggested above, it will work with very little effort
Regards,
Marco0 -
Ok Marco i respect you my problem is that i don't want load model at every loop because the execution time is critical for my application.
Do you know how do?
Thank you0 -
The Marco's advice would definitely solve your problem in the most effective way.
Another way would be to create your own iterating operator, and add model input to the operator.
Best,
radone0 -
Hi,
if performance is key I suggest to create a simple process that does nothing than read a model and deliver it to an output port:
You can then run this process, and collect the resulting ioobject:
<?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="206" width="346">
<operator activated="true" class="read_model" compatibility="5.0.10" expanded="true" height="60" name="Read Model" width="90" x="45" y="30"/>
<connect from_op="Read Model" from_port="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>
Then have your other processes use a model delivered via input port, so you can start you processes with the previously loaded model:
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
InputStream is;
// setup your input stream to your process file here
String xml = com.rapidminer.tools.Tools.readTextFile(is);
Process modelLoaderProcess = new Process(xml);
IOContainer ioResult = modelLoaderProcess .run();
if (ioResult.getElementAt(0) instanceof AbstractModel) {
AbstractModel model = (AbstractModel)ioResult.getElementAt(0);
}
That way, you will load your model once and then use it for all your other processes.
IOContainer ioInput = new IOContainer(new IOObject[]{ model });
Process otherProcess = new Process(otherXML);
IOContainer ioResult = otherProcess.run(ioInput);
Regards,
Marco0