How to run Rapidminer Process from Java console application?

nom1010nom1010 Member Posts: 8 Contributor II
edited December 2018 in Help

I built a process in Rapidminer Studio (classification with decision tree/neural net), I would like to load this process and run it with different datasets in a Java console application. I read about this here, but I didn't really found a great tutorial/documentation, how to do this, the basic things (load process, change properties, change the training model, ... ). Any advice would be helpful.

Tagged:

Best Answer

  • nom1010nom1010 Member Posts: 8 Contributor II
    Solution Accepted

    Thanks! These informations were really helpful.

     

     

    RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
    RapidMiner.init();
    Process process = new Process(new File("/MyProcessFile.rmp"));
    System.out.println(process.run());

     

     Finally I wrote this, after that I got the result. Maybe it'll be useful for others.

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    Your best bet is to use RapidMiner Server or getting an OEM license. 

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist

    @Thomas_Ott that's not right.As long as it part of the open core you can do this. I think there is no explicit documentation on it though.

     

    Easy way might be to use the CLI.

     

    Best,

    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • nom1010nom1010 Member Posts: 8 Contributor II

    Yes, I'd like a simple cli, to load the process and run the process, but I don't really know, how to load a process that I made in Rapidminer, and things like that.

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist

    Hi,

     

    rm already has an CLI. Just go for 

    rapidminer -f myfile.rmp

    or

    rapidminer //Local Repository/folder/myprocess

    .

    That works. You can also provide macros if you want to.

     

    Best,

    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • juasu56juasu56 Member Posts: 6 Contributor I

    hi ! 

     

    i'm trying to do the same but i'm getting this exception. Im using springboot and maven, i also included rapidminer libraries as dependencies in pom.xml but still, it doesn't work 

     

    can anybody help me ? 

     

    thank you

     

    <em class="error">The operator class 'jdbc_connectors:read_database' is unknown. Possibly you must install a plugin for operators of group 'jdbc_connectors'.</em>
    2018-07-14 23:48:47.970 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'define_connection' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.971 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'connection' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.971 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'database_system' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.972 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'define_query' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.972 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'query' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.973 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'query_file' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.973 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'use_default_schema' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.973 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'prepare_statement' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.973 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'parameters' of type enumeration is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.974 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'datamanagement' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.974 INFO 19264 --- [qtp411408557-27] com.rapidminer : The parameter 'data_management' is unknown for operator 'Read Database (2)' (" dummy ")."
    2018-07-14 23:48:47.975 INFO 19264 --- [qtp411408557-27] com.rapidminer : <em class="error">The output port <var>output</var> is unknown at operator <var>Read Database (2)</var>.</em>
    2018-07-14 23:48:47.980 INFO 19264 --- [qtp411408557-27] com.rapidminer.Process : No filename given for result file, using stdout for logging results!
    2018-07-14 23:48:47.982 INFO 19264 --- [qtp411408557-27] com.rapidminer.Process : Process C:\Users\juasu\git\nubyte-backend-spring\src\main\resources\ModeloReglasAsociacionV5.rmp starts
    excepcion
    com.rapidminer.operator.UserError: The dummy operator Read Database (2) (replacing jdbc_connectors:read_database) cannot be executed.
    at com.rapidminer.operator.DummyOperator.doWork(DummyOperator.java:94)
Sign In or Register to comment.