Options

Newbie: Starting RapidMiner from Command Line

IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
edited November 2018 in Help
Original message from SourceForge forum at http://sourceforge.net/forum/forum.php?thread_id=2042410&;forum_id=390413

I need to start RapidMiner from the command line, but I can't get it to load and run the referenced XML file. For example, if I type "rapidminer 03_XValidation_Numerical.xml", IAW with the documentation, the GUI loads but the nothing else happens. When I check the xml it is empty, i.e.

<operator name="Root" class="Process" expanded="yes">
</operator>

I have "RapidMiner" installed in the "C:\Program Files\Rapid-I\RapidMiner-4.1" dir and the sample files installed in the "C:\Program Files\Rapid-I\RapidMiner-4.1\sample" dir. I'm using XP and I updated the path. Any ideas on what I need type on the command line to get the xml file to run? 

Thank you in advance...


Answer by Ingo:

Hi,

I just tested this myself on Windows XP by going into the scripts directory and typing

rapidminer ../sample/04_Validation/03_XValidation_Numerical.xml

and it works. The output looks like this:

C:\home\ingo\workspace\yale\scripts>rapidminer ../sample/04_Validation/03_XVali
ation_Numerical.xml
RAPIDMINER_HOME is not set. Trying the directory 'C:\home\ingo\workspace\yale\s
ripts\..'...
Using local jre: C:\home\ingo\workspace\yale\scripts\..\jre\bin\java.exe...
Starting RapidMiner from 'C:\home\ingo\workspace\yale\scripts\..' using classes
from 'C:\home\ingo\workspace\yale\scripts\..\build'...
RapidMiner version 4.1, Copyright (C) 2001-2007
RapidMiner comes with ABSOLUTELY NO WARRANTY; This is free software,
and you are welcome to redistribute it under certain conditions;
see license information in the file named LICENSE.
G 18.05.2008 16:52:14: rapidminer.home is 'C:\home\ingo\workspace\yale\scripts\
.'.
Last message repeated 1 times.
G May 18, 2008 4:52:14 PM: ----------------------------------------------------
G May 18, 2008 4:52:14 PM: Initialization Settings
G May 18, 2008 4:52:14 PM: ----------------------------------------------------
G May 18, 2008 4:52:14 PM: Default system encoding for IO: windows-1252
G May 18, 2008 4:52:14 PM: Load core operators...
G May 18, 2008 4:52:14 PM: Load Weka operators: true
G May 18, 2008 4:52:14 PM: Load JDBC drivers from lib directory: true
G May 18, 2008 4:52:14 PM: Load JDBC drivers from classpath: false
G May 18, 2008 4:52:14 PM: Load plugins: true
G May 18, 2008 4:52:14 PM: Load plugins from 'C:\home\ingo\workspace\yale\scrip
s\..\lib\plugins'
G May 18, 2008 4:52:14 PM: ----------------------------------------------------
G May 18, 2008 4:52:14 PM: Read rcfile 'C:\home\ingo\workspace\yale\scripts\..\
tc\rapidminerrc'.
G May 18, 2008 4:52:14 PM: Trying rcfile 'C:\home\ingo\workspace\yale\scripts\.
\etc\rapidminerrc.Windows XP'...skipped
G May 18, 2008 4:52:14 PM: Trying rcfile 'C:\Dokumente und Einstellungen\ingo\.
apidminer\4_1_0_rapidminerrc'...skipped
G May 18, 2008 4:52:14 PM: Read rcfile 'C:\Dokumente und Einstellungen\ingo\.ra
idminer\4_1_0_rapidminerrc.Windows XP'.
G May 18, 2008 4:52:14 PM: Trying rcfile 'C:\home\ingo\workspace\yale\scripts\r
pidminerrc'...skipped
G May 18, 2008 4:52:14 PM: Trying rcfile 'C:\home\ingo\workspace\yale\scripts\r
pidminerrc.Windows XP'...skipped
G May 18, 2008 4:52:14 PM: Trying rapidminer.rcfile. Property not specified...s
ipped
G May 18, 2008 4:52:14 PM: Loading operators from 'operators.xml'.
G May 18, 2008 4:52:26 PM: Loading JDBC driver information from 'etc:jdbc_prope
ties.xml'.
P May 18, 2008 4:52:26 PM: Initialising process setup
P May 18, 2008 4:52:26 PM: [NOTE] No filename given for result file, using stdo
t for logging results!
P May 18, 2008 4:52:26 PM: Checking properties...
P May 18, 2008 4:52:26 PM: Properties are ok.
P May 18, 2008 4:52:26 PM: Checking process setup...
P May 18, 2008 4:52:26 PM: Inner operators are ok.
P May 18, 2008 4:52:26 PM: Checking i/o classes...
P May 18, 2008 4:52:26 PM: i/o classes are ok. Process output: PerformanceVecto
.
P May 18, 2008 4:52:26 PM: Process ok.
P May 18, 2008 4:52:26 PM: Process initialised
P May 18, 2008 4:52:26 PM: [NOTE] Process starts
P May 18, 2008 4:52:26 PM: Process:
Root[0] (Process)
+- Input[0] (ExampleSource)
+- XVal[0] (XValidation)
+- Training[0] (LibSVMLearner)
+- ApplierChain[0] (OperatorChain)
+- Test[0] (ModelApplier)
+- Evaluation[0] (RegressionPerformance)
P May 18, 2008 4:52:36 PM: [NOTE] Process finished after 10 seconds
P May 18, 2008 4:52:36 PM: Process:
Root[1] (Process)
+- Input[1] (ExampleSource)
+- XVal[1] (XValidation)
+- Training[10] (LibSVMLearner)
+- ApplierChain[10] (OperatorChain)
+- Test[10] (ModelApplier)
+- Evaluation[10] (RegressionPerformance)
P May 18, 2008 4:52:36 PM: Produced output:
IOContainer (1 objects):

PerformanceVector [
-----root_mean_squared_error: 7.271 +/- 1.398 (mikro: 7.404 +/- 0.000)
-----absolute_error: 5.107 +/- 0.949 (mikro: 5.107 +/- 5.361)
-----relative_error: 0.426 +/- 0.364 (mikro: 0.426 +/- 2.210)
-----normalized_absolute_error: 0.040 +/- 0.014 (mikro: 0.038)
-----root_relative_squared_error: 0.044 +/- 0.014 (mikro: 0.041)
-----squared_error: 54.826 +/- 20.284 (mikro: 54.826 +/- 129.593)
-----correlation: 0.999 +/- 0.001 (mikro: 0.999)
]
(created by Evaluation)

P May 18, 2008 4:52:36 PM: [NOTE] Process finished successfully
Process finished successfully


I am hence assuming there is something wrong with your path settings...

Cheers,
Ingo


Answer by topic starter:

Thank you very much for your prompt response and taking the time to answer such a newbie question. After reading your post I was able run Rapid Miner from the command line and it now works perfectly from the scripts directory. However, after updating my path settings, if I try to run Rapid Miner on Windows XP using the "START" >> "RUN" function, I still need to explicitly write the path, i.e. 

"C:\Program Files\Rapid-I\RapidMiner-4.1\scripts\rapidminer" ..\sample\04_Validation\03_XValidation_Numerical.xml

Although I still can't rule out a problem with my path settings (e.g. "C:\Program Files\Rapid-I\RapidMiner-4.1" & "C:\Program Files\Rapid-I\RapidMiner-4.1\scripts"), but thats just a minor issue since the program works fine.

Thanks again for your great support...


Answer by Steffen:

Hello

just a suggestion:
"updating my path settings" => I guess you refer to the path in system->environment etc.
As far as I know,the windows path dont like blanks => (Program Files)

greetings

Steffen

Answers

  • Options
    wesselwessel Member Posts: 537 Maven
    Is this also supposed to work on linux?

    I get:
    wessel@wegumar7:~/Desktop/rapidminer/scripts$ ls
    rapidminer  rapidminer.bat  RapidMinerGUI  RapidMinerGUI.bat
    wessel@wegumar7:~/Desktop/rapidminer/scripts$ chmod +x rapidminer
    wessel@wegumar7:~/Desktop/rapidminer/scripts$ ./rapidminer
    RAPIDMINER_HOME is not set. Trying the directory '.'...
    No maximum Java memory defined, using 512 Mb...
    Neither ./build nor ./lib/rapidminer.jar was found.
    Try 'ant build' or 'ant dist' first or check the value of RAPIDMINER_HOME!
  • Options
    colocolo Member Posts: 236 Maven
    This works fine for me. But in my case the parent folder is searched for RapidMiner home directory instead of the current folder as in your case (RAPIDMINER_HOME is not set. Trying the directory '.'...). Did you try setting the RAPIDMINER_HOME variable to ~/Desktop/rapidminer/ before the execution of the script?
    On windows you should execute rapidminer.bat, or do you use some sort of Linux shell emulation?

    Regards,
    Matthias
  • Options
    wesselwessel Member Posts: 537 Maven
    My bad, I wrote windows instead of Linux.
    The question was if this also works on Linux.
  • Options
    MarinMarin Member Posts: 19 Contributor II
    Is it possible to execute RapidMiner processes without using the graphical interface?
    E.g.: I type in command line something and after few days in output file/directory I get the results?

    If I can do it, please let me know how to (I have the possibility to use a grid computer and I am thinking about running few serial processes on it as long as it takes).
    Suppose I have process named Process.xml, input named whateve.xyz and output named cool_results.zyx, and all other files I have to have. What has to be installed on the grid/cluster in order for this to work?
    Some steps or reference to RMwiki, Manual for "console dummies" or example would be helpful.

    Cheerz,

    Marin
  • Options
    wesselwessel Member Posts: 537 Maven
    What has to be installed on the grid/cluster in order for this to work?

    I think you need to following steps:
    Go the the rapid-miner folder and use:
    - ant build
    - chmod 700 scripts/rapidminer
    - export PATH=${PATH}:`pwd`/scripts
    - export RAPIDMINER_HOME=`pwd`

    Then you can run rapidminer from anywhere using (for example):
    rapidminer com.rapidminer.
    RapidMinerCommandLine -f MyProcess.rmp

    Note that ` is not your ordinary ' but its the one next to 1 on the keyboard.

    Here is the windows version I got from Cristiano:
    http://www.rivolinet.it/wordpress/2011/04/28/run-rapidminer-5-from-the-command-line-windows/
    He notes that it is important to unselect the ‘Resolve relative…’, if you want to read files from your repository.

    #############################

    This said, this process is really cumbersome.
    I am not allowed to install Rapid Analytics on my University Grid.
    So this is not an option.
    Furthermore Rapid Analytic is not able to distribute a processes amongst many computers.

    In many cases, where you want to train lots of models, this process is almost trivial to run in parallel.
    I managed to a 1000+ times speedup using my own Java code,
    Given different data to different algorithms on a single node in the grid distributed over different threads:

    static void execute() {
    ExecutorService es = Executors.newFixedThreadPool(THREADS);
    for (int start = BEGIN; start < END; start += K) {
    int stop = start + K;
    if (stop > END) {
    stop = END;
    }
    es.execute(alg(start, stop));
    }
    es.shutdown();
    }

    And using a bash script to call this Java Class many times with different parameters,
    which automatically assigns workload to different nodes on the grid.
  • Options
    TheBearTheBear Member Posts: 18 Maven
    hello, I tried to run rm5 under windows7 via commandline. Unfortunately it failed with the following message
    11.08.2011 14:36:23 com.rapidminer.RapidMinerCommandLine run
    SEVERE: Cannot read process setup 'c:\users\XXX\desktop\test.xml': No absolute path: c:\users\XXX\desktop\test.xml
    I started with
    "C:\Program Files\Rapid-I\RapidMiner5\scripts\rapidminer" c:\users\XXX\desktop\test.xml

    Anyone who might help?
    Thx
    Sebastian
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    if possible you should use "//RepositoryName/ProcessName" as your argument, because RapidMiner works with repositories rather than the actual file system.
    However, you can still use this:
    -f "c:\users\XXX\desktop\test.rmp"


    Regards,
    Marco
Sign In or Register to comment.