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

Cross- Validation of R, Python Models

bhupendra_patilbhupendra_patil Employee-RapidMiner, Member Posts: 168 RM Data Scientist
edited November 2018 in Knowledge Base

 

RapidMiner provides ability to work with many learners in a code-free manner. However if needed one can also extend the capabilities of RapidMiner  using R & Python scripts. Even when using R or Python many of core RapidMiner's operators can still be utilized to get the best of the both worlds.

 

The following example showcases how to use Cross-Validation operator and performance operators along with R Script. Please use the attached example process file to try it yourself

 

Step 1 ) Prepare your data and pass it to "tra" port on the cross validation operator as seen below

process.png

 

As you may be aware inside the X-validation operator has two sub process. We will write our Model Training script in the training part using the execute R operator. On the testing part we will write the "Apply model" R script and use a performance operator from RapidMiner  to capture performance.

 

 

inside cross validation.png

 

 

Please note that the training script returns a model, that is passed along to the "mod" part. It is then passed to the second testing side to the first "inp" port. When using the R Script operator, the parameters are passed by order in which they are connected.

So you will notice that on training side, since we are passing model first, and then 'tes" which is your test data, the script needs to receive them in the same order. Hence the first parameter in rm_main on testing side is model and second is the data.

 

You are then using the regular RapidMiner  performance operator to capture the performance.

 

 

The training and test scripts looks like below

Training

training script.png

 

Testing

testing scripts.png

Similar techniques can be applied to combine scripting operators with other operators.

 

 

Tagged:

Comments

Sign In or Register to comment.