Options

integrating rapidminer in netbeans

ZeRo_XtZeRo_Xt Member Posts: 5 Contributor II
edited November 2018 in Help
Hello!

I'm new in this forum. i'm from Chile. I want know if you can help me about how integrating rapidminer in netbeans. I need run the API of Rapidminer in Netbeans for can be classify text. I took the software of Rapidminer to create a model and now need read the model, and can be apply this model to unlabeled data. I searched for more web pages, but unfortunately to no avail. I hope you can help, because, is for my project to my degree of engineer in informatic and computer.

thank you very much

This is what I have:

import com.rapidminer.operator.ModelApplier;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.io.ModelLoader;
import com.rapidminer.tools.OperatorService;

public static void main(String args[]) {
com.rapidminer.RapidMiner.setExecutionMode(com.rapidminer.RapidMiner.ExecutionMode.EMBEDDED_WITHOUT_UI);
        System.setProperty("rapidminer.home", "/rapidminer");
        System.setProperty(com.rapidminer.RapidMiner.PROPERTY_RAPIDMINER_INIT_PLUGINS_LOCATION, "/rapidminer/lib/plugins");
        com.rapidminer.RapidMiner.init();
        try {
            com.rapidminer.Process p = new com.rapidminer.Process();
            Operator ApplyModelo= OperatorService.createOperator(ModelApplier.class);
            p.getRootOperator().getSubprocess(0).addOperator(ApplyModelo);
         
 
            ModelLoader readmodel = OperatorService.createOperator(ModelLoader.class);
            readmodel.setUserDescription("leermodelo");
            readmodel.setParameter("model_file", "C:\\Users\\Monitos\\Documents\\modeloOut.mod");
            p.getRootOperator().getSubprocess(0).addOperator(readmodel);
            connect(readmodel,"out",ApplyModelo,"mod");


        } catch (Exception ex) {
            Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
        }
}

this is the error:

Nov 7, 2011 1:04:41 AM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: rapidminer.home is '/rapidminer'.
Nov 7, 2011 1:04:41 AM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Nov 7, 2011 1:04:42 AM com.rapidminer.tools.OperatorService registerOperators
SEVERE: Cannot read operator description file 'OperatorsCore.xml': no valid XML: null
java.lang.NullPointerException
  at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:269)
  at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:256)
...
...
...
com.rapidminer.operator.OperatorCreationException: No operator description object given for 'com.rapidminer.operator.ModelApplier'
  at com.rapidminer.tools.OperatorService.createOperator(OperatorService.java:587)
Tagged:

Answers

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

    may I point out this post: click
    It definitely is the easiest way to do things.

    Moved to Development section.

    Regards,
    Marco
  • Options
    ZeRo_XtZeRo_Xt Member Posts: 5 Contributor II
    the problem is that no load the OperatorsCore.xml i do not why

    Code:

    RapidMiner.setExecutionMode(RapidMiner.getExecutionMode().EMBEDDED_WITH_UI);
    System.setProperty("rapidminer.home", "C:\\Program Files\\Rapid-I\\RapidMiner5\\lib");
    RapidMiner.init();


    Error:

    SEVERE: Cannot read operator description file 'OperatorsCore.xml': no valid XML: null
    java.lang.NullPointerException

    Help me please!!!!

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

    Looks like he cannot find the OperatorsCore.xml file. Probably because RapidMiner is not correctly added as a library to your project.
    I never used Netbeans so I cannot help you there, but in Eclipse I just add the whole RapidMiner project as a dependency and it works fine.
    To check out RapidMiner sourcecode see here: http://rapid-i.com/content/view/24/47/lang,en/
    Otherwise you'd probably have to add a lot of libs from the RapidMiner lib folder to your project.

    Oh and by the way, you might want to remove that line: System.setProperty("rapidminer.home", "C:\\Program Files\\Rapid-I\\RapidMiner5\\lib");

    Regards,
    Marco
  • Options
    ZeRo_XtZeRo_Xt Member Posts: 5 Contributor II
    Hi,

    Wich library add to you project in Eclipse? i added to my project:

    -encong.jar
    -joone-engine.jar
    -launcher.jar
    -rapidminer.jar

    I'm using Rapidminer5

    Regads,
    Luis

  • Options
    ZeRo_XtZeRo_Xt Member Posts: 5 Contributor II
    i found the problem! added all the libraries and works!!!

    Regads,
    Luis
Sign In or Register to comment.