"Integrating RapidMiner into a Java application"

nicugeorgiannicugeorgian Member Posts: 31 Maven
edited May 2019 in Help
I created a small Java archive (jar) that uses RapidMiner to return a "forecast" in the form of a regression tree. To get regression trees, I use a Weka operator.

I plan to upload this jar file on a server such that it can be invoked, through some application, by several users / clients.

It's not very clear to me yet how RapidMiner will be integrated. I would need your help in this respect  :)

1. Is it enough if I have the jar files rapidminer.jar and weka.jar on the server and I point to them (with the "classpath" option) when the jar file gets called?  ???
Or should I install RapidMiner on the server? I assume RapidMiner shoould not be installed on the clients' machines.

2. If it's necessary to install RapidMiner on the server, should I also have (in the Java application) the following two lines before any RapidMiner operator gets invoked?

System.setProperty("rapidminer.home", "a directory on the server where a lib directory exists containing weka.jar and rapidminer.jar");
RapidMiner.init(true, false, false, false);
Is this correct?  ???

3. Is there a way to only upload the RapidMiner operators my Java application invokes?

4. I assume I should implement the Java application to be thread-safe such that it can safely be called by clients/users. Is this so?

Thanks for any suggestion,
Geo
Tagged:

Answers

  • IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hello,

    first of all I would like to clarify something else (just because we recently had some bad experience with a similar request): under which license you are going to use RapidMiner and which is the license of your web service? Many people unfortunately misbelieve that "hiding" the software behind a web service and decoupling RapidMiner from their own application in this way would be a correct way of allowing any license - which isn't true. So please contact us at contact@rapid-i.com for discussing the licensing details.

    I don't want to sound rude but I simply would like to clarify those things as early as possible so that no harm is done and no work is done for nothing...


    ad 1)
    The jar file is usually sufficient if you invoke the operators from your own code.

    ad 2)
    see above

    ad 3)
    yes, it is actually possible to "strip" RapidMiner down but it is quite tedious work and often not worth the effort.

    ad 4)
    if you have complete processes, you can usually run it within a thread independent of anything else. So simply run a single independent process for each client should be fine.


    Cheers,
    Ingo
  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    Even if I include weka.jar in classpath and build path (I use Eclipse), I still get
    Load Weka operators: weka not found
    Consequently, it complains every time I use a string based creation of a Weka operator. Could you please give me some suggestions in this respect?

    The problem dissapears if I explicitly set the property rapidminer.home:
    System.setProperty("rapidminer.home", "..........")
    I would, however, prefer not to set the property. I better include the necessary jar files in classpath.
    Ingo Mierswa wrote:

    ad 1)
    The jar file is usually sufficient if you invoke the operators from your own code.
    What do you exactly mean with "invoke the operators from your own code"?

    Do you mean that I should create operators using the corresponding class names instead of operators' descriptions? Like in the following example?
    Operator inputOperator = OperatorService.createOperator(SimpleExampleSource.class);
    If yes, what about the operators that don't have their own class, e.g., the Weka operator W-M5P? In this case, should one use a string based creation, with the operator description? Like the following?
    Learner learner = (Learner) OperatorService.createOperator("W-M5P"); 
    If yes, how can I then set up the parameters specific to W-M5P? I guess in such a case, I should still use the string based operator creation.
    Ingo Mierswa wrote:

    ad 2)
    see above
    I assume the initialization line
    RapidMiner.init(true, false, false, false);
    is still necessary, isn't it?
    Ingo Mierswa wrote:

    ad 4)
    if you have complete processes, you can usually run it within a thread independent of anything else. So simply run a single independent process for each client should be fine.
    I only have one (small) process. How can it be ensured that the process is run independently by each client? Could you pls give me some tips.

    Many thanks!
  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    Ingo Mierswa wrote:

    ad 1)
    The jar file is usually sufficient if you invoke the operators from your own code.
    In an earlier thread (see http://rapid-i.com/rapidforum/index.php/topic,53.0.html), you wrote:
    In the next version, you will no longer have to specify rapidminer.home at all any longer (it is now only necessary for weka ...
    At that time, the version was 4.2. Now, with version 4.3,  if I don't set the property rapidminer.home, I get the same exception concerning the missing W-M5P's operator description. Please: any ideas?

    There's also something else: what string should one use to create the corresponding operator: "M5P" or "W-M5P"?

    Thanks!
  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    nicugeorgian wrote:

    if I don't set the property rapidminer.home, I get the same exception concerning the missing W-M5P's operator description.
    Pls help!

    Did anyone make use of a weka operator without setting the rapidminer.home property? Is it possible at all to skip setting this property?

    Thanks!
Sign In or Register to comment.