RapidMiner and Java integration

kkdataminerkkdataminer Member Posts: 10 Contributor II
edited November 2018 in Help

Hi There,

 

I wrote a Java program which generates a results excel file. I want to use this results excel file dynamically as an input to RapidMiner process inside a java application.

In another terms, when I run rapidMiner process from Java application , it should read results excel file which is generated by Java program and run rest of the process.Any help on this would be greatly appreciated.

 

Thanks

Tagged:

Best Answer

  • kkdataminerkkdataminer Posts: 10 Contributor II
    Solution Accepted
    I changed the operator to Read Excel and it worked fine. Closing this issue

Answers

  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,150   Unicorn

    Hi there, I am not totally sure what the question is, since RapidMiner Studio has a native "read Excel" operator that should enable you to read the excel file you have produced without difficulty.  However, if you are looking for functionality for RapidMiner to kick off a process automatically whenever that file is produced, then you will need to utilize RapidMiner Server in addition to RapidMiner Studio.  Studio alone doesn't allow the batch scheduling of jobs or jobs to be based on triggers, but Server does.  There is a free version of Server available and lots of resources here on getting that set up.  In fact I wrote a blog post just last week about how to set one up on AWS for free, so if you are interested in that you can check it out here: https://rapidminer.com/installing-rapidminer-server-aws/

     

    There is also a Server forum where you can ask any questions you might have about scheduled or triggered jobs.

     

     

     

     

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
    Thomas_Ott
  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761   Unicorn

    Another thought is to use the Execute Program operator in Studio. This way you can kick off your Java program inside the process and load in whatever results your Java program returns.

  • kkdataminerkkdataminer Member Posts: 10 Contributor II

    I wrote the below code. RPM process is reading the excel from Local Repository instead of the path mentioned in the java code. Am I missing something here? How to make the RPM process read the excel from local drive? Any help on this would be greatly appreciated.

     

    import com.rapidminer.Process;
    import com.rapidminer.RapidMiner;
    import com.rapidminer.example.ExampleSet;
    import com.rapidminer.operator.IOContainer;
    import com.rapidminer.operator.Operator;
    import com.rapidminer.operator.OperatorException;
    import com.rapidminer.operator.nio.ExcelExampleSource;
    //import com.rapidminer.operator.io.ExcelExampleSource;
    import com.rapidminer.tools.XMLException;
    import java.io.File;
    import java.io.IOException;
    public class Sample_RapidMiner {
    public static void main(String[] args) throws XMLException, OperatorException {
    try {
    RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
    RapidMiner.init();
    Process process = new Process(new File("C:\\Users\\koushik\\Documents\\Java RapidMiner Integration\\RapidMinerInJava\\RapidMinerInJava\\BPDictionaryOutputCount.rmp"));
    Operator op = process.getOperator("Retrieve");
    op.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "C:\\Users\\koushik\\Documents\\Java RapidMiner Integration\\RapidMinerInJava\\BPDictionary.xlsx");
    process.run();
    } catch (IOException ex) {
    ex.printStackTrace();
    }
    }
    }

  • rjoliveirarjoliveira Member Posts: 1 Contributor I

    I wrote the below code. but i have this error when a run the code?.
    the objective is to run RPM process and reading the excel from Local Repository of the path mentioned in the java code. Any help on this would be greatly appreciated.
    this is the code
    import com.rapidminer.RapidMiner;

    public class errorapidminer {

    public static void main(String[] args) {
    RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);

    RapidMiner.init();

    }

    }
    and thisis the error


    Feb 15, 2017 2:47:07 PM com.rapidminer.tools.I18N <clinit>
    INFO: Set locale to en.
    Feb 15, 2017 2:47:09 PM com.rapidminer.tools.PlatformUtilities logInfo
    INFO: rapidminer.home is 'C:\Program Files\RapidMiner\RapidMiner Studio'.
    Feb 15, 2017 2:47:09 PM com.rapidminer.core.license.ProductConstraintManager initialize
    INFO: Initializing license manager.
    Feb 15, 2017 2:47:09 PM com.rapidminer.core.license.ProductConstraintManager initialize
    INFO: Using default license location.
    Feb 15, 2017 2:47:09 PM com.rapidminer.core.license.ProductConstraintManager initialize
    INFO: Registering default product.
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: Cloud Connectivity
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: Cloud Execution
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: Data Editor
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: H2O
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: Operator Recommender
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: Process Scheduling
    Feb 15, 2017 2:47:16 PM com.rapidminer.tools.plugin.Plugin registerPlugins
    INFO: Register plugin: Advanced File Connectors

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761   Unicorn

    Can you just use the RapidMiner Server to do this?

  • rauljorgeoliveirauljorgeolivei Member Posts: 1 Contributor I

    Hello
    I used the rapidmine studion education library and got the same error.
    Where I can download the correct library of rapidmine studion education.
    Can you help me. This un problem of university i need use rapidminer jar in eclipse tu run my aplication

    thanks

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761   Unicorn

    I would suggest you check out the Developer's section here: http://docs.rapidminer.com/developers/

     

    All the classpath's and dependencies for RapidMiner are spelled out there. 

Sign In or Register to comment.