The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Integrating RapidMiner into your java application"
Hello All,
I am a student working on RapidMiner for some time now, I love the tool and appreciate the effort that has gone and still going into this product, but recently I have been having problems when I tried to integrate RM into my java application. I seem to have figured out the whole I/O port logic in RM 5.1, but the problem comes when I use a "XValidation" operator chain into my program. As far as I understand, you have to connect all the I/O ports so that the data can flow between the operators, which means every following operator's input port is connected to the preceding operator's output port. However I dont know how to configure the input port of neural net learner (the first inner operator), since there is no port for it to connect to. So I keep getting the error "No data was deliverd at port NeuralNet.training set." Any help is appreciated. Thanks!
The process goes something like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.1.001" expanded="true" name="Process">
<process expanded="true" height="359" width="413">
<operator activated="true" class="retrieve" compatibility="5.1.001" expanded="true" height="60" name="Retrieve" width="90" x="45" y="75">
<parameter key="repository_entry" value="//Samples/data/Iris"/>
</operator>
<operator activated="true" class="x_validation" compatibility="5.1.001" expanded="true" height="112" name="Validation" width="90" x="313" y="120">
<description>A cross-validation evaluating a decision tree model.</description>
<process expanded="true" height="654" width="466">
<operator activated="true" class="neural_net" compatibility="5.1.001" expanded="true" height="76" name="Neural Net" width="90" x="112" y="255">
<list key="hidden_layers"/>
</operator>
<operator activated="true" class="write_model" compatibility="5.1.001" expanded="true" height="60" name="Write Model" width="90" x="313" y="300">
<parameter key="model_file" value="D:\Bhavya\RapidMiner\test2.mod"/>
<parameter key="output_type" value="XML"/>
</operator>
<connect from_port="training" to_op="Neural Net" to_port="training set"/>
<connect from_op="Neural Net" from_port="model" to_op="Write Model" to_port="input"/>
<connect from_op="Write Model" from_port="through" to_port="model"/>
<portSpacing port="source_training" spacing="0"/>
<portSpacing port="sink_model" spacing="0"/>
<portSpacing port="sink_through 1" spacing="0"/>
</process>
<process expanded="true" height="654" width="466">
<operator activated="true" class="apply_model" compatibility="5.1.001" expanded="true" height="76" name="Apply Model" width="90" x="45" y="30">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="performance" compatibility="5.1.001" expanded="true" height="76" name="Performance" width="90" x="179" y="30"/>
<connect from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
<connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
<portSpacing port="source_model" spacing="0"/>
<portSpacing port="source_test set" spacing="0"/>
<portSpacing port="source_through 1" spacing="0"/>
<portSpacing port="sink_averagable 1" spacing="0"/>
<portSpacing port="sink_averagable 2" spacing="0"/>
</process>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Validation" to_port="training"/>
<connect from_op="Validation" from_port="model" to_port="result 1"/>
<connect from_op="Validation" from_port="averagable 1" to_port="result 2"/>
<portSpacing port="source_input 1" spacing="36"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
I am a student working on RapidMiner for some time now, I love the tool and appreciate the effort that has gone and still going into this product, but recently I have been having problems when I tried to integrate RM into my java application. I seem to have figured out the whole I/O port logic in RM 5.1, but the problem comes when I use a "XValidation" operator chain into my program. As far as I understand, you have to connect all the I/O ports so that the data can flow between the operators, which means every following operator's input port is connected to the preceding operator's output port. However I dont know how to configure the input port of neural net learner (the first inner operator), since there is no port for it to connect to. So I keep getting the error "No data was deliverd at port NeuralNet.training set." Any help is appreciated. Thanks!
The process goes something like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.1.001" expanded="true" name="Process">
<process expanded="true" height="359" width="413">
<operator activated="true" class="retrieve" compatibility="5.1.001" expanded="true" height="60" name="Retrieve" width="90" x="45" y="75">
<parameter key="repository_entry" value="//Samples/data/Iris"/>
</operator>
<operator activated="true" class="x_validation" compatibility="5.1.001" expanded="true" height="112" name="Validation" width="90" x="313" y="120">
<description>A cross-validation evaluating a decision tree model.</description>
<process expanded="true" height="654" width="466">
<operator activated="true" class="neural_net" compatibility="5.1.001" expanded="true" height="76" name="Neural Net" width="90" x="112" y="255">
<list key="hidden_layers"/>
</operator>
<operator activated="true" class="write_model" compatibility="5.1.001" expanded="true" height="60" name="Write Model" width="90" x="313" y="300">
<parameter key="model_file" value="D:\Bhavya\RapidMiner\test2.mod"/>
<parameter key="output_type" value="XML"/>
</operator>
<connect from_port="training" to_op="Neural Net" to_port="training set"/>
<connect from_op="Neural Net" from_port="model" to_op="Write Model" to_port="input"/>
<connect from_op="Write Model" from_port="through" to_port="model"/>
<portSpacing port="source_training" spacing="0"/>
<portSpacing port="sink_model" spacing="0"/>
<portSpacing port="sink_through 1" spacing="0"/>
</process>
<process expanded="true" height="654" width="466">
<operator activated="true" class="apply_model" compatibility="5.1.001" expanded="true" height="76" name="Apply Model" width="90" x="45" y="30">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="performance" compatibility="5.1.001" expanded="true" height="76" name="Performance" width="90" x="179" y="30"/>
<connect from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
<connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
<portSpacing port="source_model" spacing="0"/>
<portSpacing port="source_test set" spacing="0"/>
<portSpacing port="source_through 1" spacing="0"/>
<portSpacing port="sink_averagable 1" spacing="0"/>
<portSpacing port="sink_averagable 2" spacing="0"/>
</process>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Validation" to_port="training"/>
<connect from_op="Validation" from_port="model" to_port="result 1"/>
<connect from_op="Validation" from_port="averagable 1" to_port="result 2"/>
<portSpacing port="source_input 1" spacing="36"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
Sorry, I cannot reproduce your error. All in all the process looks fine and it ran without any problems. I am using rm 5.1.
If the posted process does not work "as code", you should post that code here. Otherwise it is hard for us to guess where the error is located .
greetings,
steffen
Thanks for your reply, yeah the process works fine from the RM GUI, but I cant seem to get it to work in my java program. I should have posted the code as well, sorry about that, here it goes:
Sorry for the late reply ... this is also nothing one can check on the fly. Warning: I am also trying to get familiar with rapido again (after a long break), so this code may suboptimal.
Here are some remarks:
- used ImprovedNeuralNetLearner.class as learner since the NeuralNetLearner in your code has not sufficient capabilities for the iris-dataset
- added the %{a} - macro to the model-writer-filename so the model of every training step is written
- shifted some code - blocks around for the sake of readability
As far as I see, you have forgotten to link the ports of the subprocesses of xvalidation to the input/output ports of the operators in the corresponding subprocess. This is really the only intelligent modification I have made . I hope this also works for yougreetings,
steffen
Thanks you so much for your code, it really helped me out. I was stuck at that problem for days, now it works. Thanks again