"Weka learner - no operator description"

nicugeorgiannicugeorgian Member Posts: 31 Maven
edited May 2019 in Help
Hello,

I tried to define a Weka Learner for building a regression tree. This learner appears as "W-M5P" in the RapidMiner GUI.

This is the definition I use:

Learner learner = (Learner) OperatorService.createOperator("M5P");

Unfortunately, I get the the following exception:

data:com.rapidminer.operator.OperatorCreationException: No operator description object given for 'M5P
at com.rapidminer.tools.OperatorService.createOperator

Note that I get the same exception if I try, for example, to use the J48 learner.

This is what I did so far (I'm using the Eclipse platform for Java):

1. In Eclipse, I have (myself) built the Java classes corresponding to the Java source files in the folder

C:\Program Files\Rapid-I\RapidMiner-4.1beta2\src   

The output folder's name is C:\Program Files\Rapid-I\RapidMiner-4.1beta2\build

2. I have added the above "build" class folder to the Java build path of the project

3. I have defined the variable "rapidminer.home" to point to

C:\Program Files\Rapid-I\RapidMiner-4.1beta2\lib\rapidminer.jar

Could you please help me with this matter?

Thank you!
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 Geo,

    please try to point the variable "rapidminer.home" to the place where a lib directory exists containing the file weka.jar, e.g. try

    System.setProperty("rapidminer.home", "C:\\Dokumente und Einstellungen\\Mierswa\\Eigene Dateien\\workspace\\yale");
    RapidMiner.init();
    (of course with a correct path)

    In the next version, you will no longer have to specify rapidminer.home at all any longer (it is now only necessary for Weka, for all other purposes (plugins etc.) there exist new global setting possibilities. But for now the solution above should work. Of course you would have to ensure that the file "weka.jar" is actually there  ;)

    Cheers,
    Ingo

  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    Hi Ingo,

    Thank you very much for the help.

    I've set the "rapidminer.home" variable to "C://Program Files/Rapid-I/RapidMiner-4.1beta2/" and not to the work space (as you did).

    And, yes, it worked!  :) Thanks!

    Unfortunately, I got an java.lang.OutOfMemoryError :(

    Probably, I should reduce the size of my training data set (~ 67'000 records with 14 attributes) ... or is there a memory size limit imposed by RapidMiner (which can be changed)?

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

    Probably, I should reduce the size of my training data set (~ 67'000 records with 14 attributes) ... or is there a memory size limit imposed by RapidMiner (which can be changed)?
    67000 with 14 attributes does not sound too much to me but this of course depends on the learner. Tree based learners always need more memory than for example NaiveBayes.

    Did you try to increase the heap size setting of your Java program? Try -Xmx800m or something similar as start option for your program so that it is able to use more memory (just search at google for Java heap size setting).

    In principal, there is no limit for memory included in RapidMiner. With 64 bit machines, you can use (almost) arbitrary amounts of memory (but you have to tell Java this, see above). If you work directly on databases, which is possible with a certain setting in the DBExampleSource operator, there are no limits at all. But this will not properly work for all types of processes and is rather slow so we recommend to work in memory whenever this is possible.

    Cheers,
    Ingo
  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    mierswa wrote:

    Try -Xmx800m or something similar as start option for your program so that it is able to use more memory
    I did that, but I still get the error  :( The error actually shows as soon as the first iteration of the (regression tree) learner starts.

    Thanks anyway for all your hints!
  • IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hi,

    I am not too familiar with M5P so maybe this learner just needs a lot of memory... you could try to transform your data to only nominal (using a discretization operator) or only numerical (using the appropriate preprocessing operators) and try other learners instead. Of course increasing the main memory and changing to a 64 bit always is an option...

    Cheers,
    Ingo
  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    Hi,

    I have changed my eclipse.ini file such that it now looks as follows:

    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256M
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms64m
    -Xmx800m
    And, as I said, I still get that OutOfMemoryError. I, however, think that changing the eclipse.ini file did not matter at all. Why am I saying this?

    Because I've also modified the RapidMinerGUI.bat file such that it now has
    if "%MAX_JAVA_MEMORY%"=="" set MAX_JAVA_MEMORY=1024
    and, surprise, the RapidMiner tool does not throw anymore the OutOfMemoryError. However, the Java program(developed in Eclipse) that uses the RapidMiner library still throws the OutOfMemoryError ...

    Cheers,
    Geo
  • UsernameUsername Member Posts: 39 Maven
    nicugeorgian wrote:

    I have changed my eclipse.ini file such that it now looks as follows:

    and, surprise, the RapidMiner tool does not throw anymore the OutOfMemoryError. However, the Java program(developed in Eclipse) that uses the RapidMiner library still throws the OutOfMemoryError ...
    The eclipse.ini file changes the memory settings for Eclipse but as I understand you want to increase memory for your application. If you run your program inside Eclipse you can set memory parameters (-Xmx1024m) via "Run" -> "Open Run Dialog" -> "Arguments" -> "VM arguments".
  • nicugeorgiannicugeorgian Member Posts: 31 Maven
    Username wrote:

    If you run your program inside Eclipse you can set memory parameters (-Xmx1024m) via "Run" -> "Open Run Dialog" -> "Arguments" -> "VM arguments".
    Yes, it worked!  :D Thank you very much Username.
Sign In or Register to comment.