Options

[SOLVED] without

MarcMarc Member Posts: 11 Contributor II
edited November 2018 in Help
Dear  members,

I have a quite simple question. If I want to integrate rapidminer process to my java application without instalation rapidminer on my computer, what I need to do?

ex: my code is:

import com.rapidminer.tools.OperatorService;
import com.rapidminer.RapidMiner;
import com.rapidminer.Process;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorException;
import java.io.IOException;

public class ProcessCreator {

   public static Process createProcess() {
try {
       // invoke init before using the OperatorService
   RapidMiner.init();
} catch (IOException e) { e.printStackTrace(); }

// create process
Process process = new Process();
try {
   // create operator
   Operator inputOperator =
       OperatorService.createOperator(ExampleSetGenerator.class);
       
   // set parameters
   inputOperator.setParameter("target_function", "sum classification");
   
   // add operator to process
   process.getRootOperator().addOperator(inputOperator);

   // add other operators and set parameters
   // [...]
} catch (Exception e) { e.printStackTrace(); }
return process;
   }

   public static void main(String[] argv) {
// create process
Process process = createProcess();
// print process setup
System.out.println(process.getRootOperator().createProcessTree(0));

try {
   // perform process
   process.run();
   // to run the process with input created by your application use
       // process.run(new IOContainer(new IOObject[] { ... your objects ... });
} catch (OperatorException e) { e.printStackTrace(); }
   }
}
how can I run this code, if I didn't install rapidminer or eclipse?

Thank you for your answer
Tagged:

Answers

  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    please use the search function next time.
    1) Have a look here: click
    2) What do you mean, without RapidMiner and Eclipse - you of course need to create a .jar which contains all necessary libraries and settings. Just setup RapidMiner als a library for your java project as you would with any other library.

    Regards,
    Marco
  • Options
    MarcMarc Member Posts: 11 Contributor II
    Why my program crash when I call rapidminer.init() method?  http://rapid-i.com/wiki/index.php?title=Integrating_RapidMiner_into_your_application#RapidMiner_as_a_library first point referes to we should have rapidminerrc in rapidminer.home/etc, what if I haven't rapidminer.home directory because I didn't want to install rapiminer on my computer?
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    Sadly parts of the wiki are out of date. You don't need to create files or folders, just add RM as a library to your java project in your favorite IDE and when you deploy your application make sure the libraries you use are part of your application.
    Also I have no clue about your error because basically saying "my program crashes, why?" provides no information at all.

    Regards,
    Marco
  • Options
    MarcMarc Member Posts: 11 Contributor II
    HI, Marco
    thank you for your answer. My program runs well till I call method rapidminer.init(). Then program finishes. I tried to surround this method by try-catch with printing an error message inside but nothing happened. Each of the order classes or methods implemented by rapidminer runs ok, so I cannot even guess where is the problem. Without calling this method my program finishes when constructor Process(processasXML) is called with an error message "unknown operator class process".
    Could you advise me please?
  • Options
    MarcMarc Member Posts: 11 Contributor II
    I've solved it. The problem was missing library com.rapid-i.launcher. I'am sorry I will look more carefully next time.

    Have a nice day
Sign In or Register to comment.