"[SOLVED] Execute R Script operator inside Sliding Window Validation = RM Crash"

molipetmolipet Member Posts: 2 Contributor I
edited June 2019 in Help
Hi Folks,

I use Mac OS X Lion 10.7.4, and R version 2.12.2 (2011-02-25). My R extension in RM works properly, I can use the R console, and so on...

I'd like to store the labelled example set (especially confidence, prediction informations) in every iteration of Sliding Window Validation.
So basically, in the Training part of Sliding Window Validation I have a k-nn. In the Testing part I have an Apply Model and a Forecasting Performance operator. This process is working fine.

And to store some part of the example set I put an Execute R Script operator inside the Testing part of the validation. Namely the Execute R Script is connect to the example set output of the Forecasting Performance operator. I set an input parameter of the R script, and the body of the script is 'print("OK")', nothing else.

So the interesting part of my process is shown below:

<operator activated="true" class="series:sliding_window_validation" compatibility="5.1.002" expanded="true" height="112" name="Validation (2)" width="90" x="447" y="165">
<parameter key="training_window_width" value="90"/>
<parameter key="training_window_step_size" value="1"/>
<parameter key="test_window_width" value="1"/>
<process expanded="true" height="422" width="283">
 <operator activated="true" class="k_nn" compatibility="5.2.006" expanded="true" height="76" name="k-NN" width="90" x="45" y="165">
<parameter key="k" value="11"/>
<parameter key="weighted_vote" value="true"/>
<parameter key="measure_types" value="NumericalMeasures"/>
<parameter key="nominal_measure" value="SimpleMatchingSimilarity"/>
<parameter key="numerical_measure" value="CosineSimilarity"/>
 <connect from_port="training" to_op="k-NN" to_port="training set"/>
 <connect from_op="k-NN" from_port="model" to_port="model"/>
 <portSpacing port="source_training" spacing="0"/>
 <portSpacing port="sink_model" spacing="0"/>
 <portSpacing port="sink_through 1" spacing="0"/>
<process expanded="true" height="629" width="283">
 <operator activated="true" class="apply_model" compatibility="5.2.006" expanded="true" height="76" name="Apply Model (2)" width="90" x="45" y="30">
<list key="application_parameters"/>
 <operator activated="true" class="series:forecasting_performance" compatibility="5.1.002" expanded="true" height="76" name="Performance (2)" width="90" x="45" y="165">
<parameter key="horizon" value="1"/>
 <operator activated="true" class="r:execute_script_r" compatibility="5.1.004" expanded="true" height="76" name="Execute Script (R)" width="90" x="155" y="265">
<parameter key="script" value="print(&quot;OK&quot;)"/>
<enumeration key="inputs">
 <parameter key="name_of_variable" value="ex"/>
<list key="results"/>
 <connect from_port="model" to_op="Apply Model (2)" to_port="model"/>
 <connect from_port="test set" to_op="Apply Model (2)" to_port="unlabelled data"/>
 <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Performance (2)" to_port="labelled data"/>
 <connect from_op="Performance (2)" from_port="performance" to_port="averagable 1"/>
 <connect from_op="Performance (2)" from_port="example set" to_op="Execute Script (R)" to_port="input 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"/>
When I play the process I get a "com.rapidminer.gui.RapidMinerGUI quit unexpectedly while using the libjri.jnilib plugin." message and on the console:

Jun 20, 2012 11:44:41 PM com.rapidminer.Process setProcessLocation
INFO: Decoupling process from location //NewLocalRepository/testProcess. Process is now associated with file //NewLocalRepository/testProcess.
Jun 20, 2012 11:44:48 PM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Jun 20, 2012 11:44:48 PM com.rapidminer.Process run
INFO: Process //NewLocalRepository/testProcess starts
Jun 20, 2012 11:44:48 PM com.rapidminer.Process loadInitialData
INFO: Loading initial data.
Jun 20, 2012 11:44:56 PM com.rapidminer.tools.WrapperLoggingHandler log
INFO: Execute Script (R): Error: protect(): protection stack overflow

Exception in thread "ProcessThread" Exception in thread "ProcessThread" Exception in thread "ProcessThread" Exception in thread "ProcessThread" java(5744,0x119de3000) malloc: *** error for object 0x77e5b4298: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
When I used Execute R Script in a X-Validation operator I got the same problem.
But when I used the Execute R Script (with the same properties) in the Main Process, it worked properly (There was no "package ?mlr? is not available" warning)

Thanks for any help!



  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Hi Peter,

    thanks for your report. At this time I can't see anything bad with your process setup, so obviously you have found a bug. If you want to use R just to store the data, you can use other operators until we fix it. Write CSV or Store should also do the job.
    It would be nice if you could report the bug also on bugs.rapid-i.com.

    Best, Marius
  • molipetmolipet Member Posts: 2 Contributor I
    Hi Marius,

    thanks for your replay. Finally I solved the storing with combination of Read CSV, Append and Write CSV operators.
    As you asked me, I've reported the bug.
    So this is "Bug 1209" (http://bugs.rapid-i.com/show_bug.cgi?id=1209)

Sign In or Register to comment.