"Integrating RM5 process in a Java application"

im
im New Altair Community Member
edited November 5 in Community Q&A
Hi, I have a little rapid miner 5 process that simply reads a csv, changes attribute to label and then i aply a decision tree. It runs ok.

How can I export that process in order to be possible to run it from a Java application?
Any little sample would be very appreciated.

Suppose I have defined these two operators:


Operator inputOperator = OperatorService.createOperator("read_csv.class");
inputOperator.setParameter("file_name","C:\\ing.csv");

Operator inputOperator2 = OperatorService.createOperator("set_role.class");
inputOperator2.setParameter("name","value");
inputOperator2.setParameter("target_role","label");

How do I connect the read CVS to the setRole operator?

Thanks a lot

IM
Tagged:

Answers

  • land
    land New Altair Community Member
    Hi,
    you could save a process designed in RapidMiner to xml and then load it using new Process(file) and execute it via process.run.

    Greetings,
      Sebastian
  • im
    im New Altair Community Member
    Thank you Sebastian.



    I used the option menu File|Export process to write it to xml file. Then when i try to load it the compiler says:

    [Fatal Error] :1:1: Content is not allowed in prolog.
    com.rapidminer.tools.XMLException: Cannot parse document: Content is not allowed in prolog.
            at com.rapidminer.Process.readProcess(Process.java:887)
            at com.rapidminer.Process.readProcess(Process.java:862)
            at com.rapidminer.Process.<init>(Process.java:225)
            at BkThread.createModel(BkThread.java:77)
            at BkThread.MakeAndExecuteModel(BkThread.java:47)
            at BkThread.run(BkThread.java:31)


    Any help?
    IM
  • land
    land New Altair Community Member
    Hi,
    would you post or attach a link on this process file?

    Greetings,
      Sebastian
  • im
    im New Altair Community Member
    How sad... it was invisible characters :-(

    It is running now very well.

    Thank you.

    IM