Integration of RapidMiner in Java application

前端 未结 3 852
北荒
北荒 2021-01-03 04:00

I have a text classification process in RapidMiner. It reads the test data from specified excel ssheet and does the classification. I have also a small Java application whic

3条回答
  •  我在风中等你
    2021-01-03 04:44

    Works fine for me:

    • Download Rapidminer (and unzip the file)
    • Into "lib" directory, you need:
      1. rapidminer.jar
      2. launcher.jar
      3. All jar in "/lib/freehep" directory.
    • Put libs 1, 2 and 3 in your classpath java project (libraries)
    • Copy this code and run:
    
    
        import com.rapidminer.Process;
        import com.rapidminer.RapidMiner;
        import com.rapidminer.operator.Operator;
        import com.rapidminer.operator.OperatorException;
        import com.rapidminer.operator.io.ExcelExampleSource;
        import com.rapidminer.tools.XMLException;
        import java.io.File;
        import java.io.IOException;
        import java.lang.Object;
    
        public class ReadRapidminerProcess {
          public static void main(String[] args) {
            try {
              RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
              RapidMiner.init();
    
              Process process = new Process(new File("/your_path/your_file.rmp"));
              process.run();
    
            } catch (IOException | XMLException | OperatorException ex) {
              ex.printStackTrace();
            }
          }
        }
    
    

    I hope to help you, I searched a lot before finding the answer.

提交回复
热议问题