The scenario: You’ve spent quite some time setting up your RapidMiner Studio with R and Python and building processes that effortlessly flow between them. Now you want to operationalize them in to your business application via RapidMiner AI Hub (formerly RapidMiner Server). You do a simple “Save As” and save the processes on the RapidMiner AI Hub and then hit “Run on Server.”
A few seconds later, your process crashes. It didn’t work!
You think you made a mistake and take another look at your data dependencies. Is the database connected to your data source? Is it a Process Path issue?
No! Chances are you forgot to tell RapidMiner AI Hub where your R and Python executables are installed!
R and Python Configuration Settings in RapidMiner Studio
Tip: You are not bound by the distribution or version when using R and Python. However, you must have the DataTables library installed for R to work with RapidMiner and the Pandas module for Python to work with RapidMiner.
Executing R and Python Scripts in RapidMiner AI Hub
The power of RapidMiner Studio lies in the ability to use many different data science tools, like scripting languages. You can do all your analysis and evaluate your results in the RapidMiner platform. The power of RapidMiner AI Hub is then putting those scripts in a production environment. To go from analysis and evaluation of R and Python scripts on RapidMiner Studio to production on RapidMiner AI Hub, you need to do two things:
- Install the R Scripting and Python Scripting extensions on RapidMiner AI Hub
- Add the Path properties.
Installing the extensions on RapidMiner AI Hub is easy and we’ve covered how to do it here.
To check out what your properties are you must navigate to Administration > System Settings in RapidMiner AI Hub. If you have Admin rights, you should be able to see this dialog box.
Below is my base RapidMiner AI Hub System Settings. I have not added in the properties that tell RapidMiner AI Hub where the R and Python executables are installed.
So how do you exactly do that? How do you define the property correctly so that RapidMiner AI Hub can execute your R and Python Scripts?
The answer lies in your RapidMiner Studio configuration file! Below is a snapshot from my personal configuration file. You can access yours in your configuration file by going to user’s directory and navigating to: \\.RapidMiner\rapidminer-studio-settings.cfg
I boxed in red the properties that you’ll use from RapidMiner Studio in you RapidMiner AI Hub. The properties for setting the Path’s for either your R or Python scripts to be executed inside RapidMiner AI Hub are:
The values you add to the dialogue box WILL BE DIFFERENT than mine. I happened to have a local installation of RapidMiner AI Hub, so both my RapidMiner Studio and AI Hub reference the same executables.
If you have RapidMiner AI Hub installed on its own box and R and Python are the same box as well, then you’ll Path might be something like /usr/bin/python (if you’re running Linux).
Below are my updated System Settings calling the executable Path for both Python and R.
That’s it! It’s as simple as that to empower your RapidMiner AI Hub with R and Python!
Tip: You can hack the System Settings with other properties as well. Just browse through your rapidminer-studio-settings.cfg file for more properties.