Dynamically add input to RapidMiner through Java -


I need dynamically input files in my Java application and have to use miter quickly for classification. I have the following code:

  RapidManer. Setexuation mode (RapidManor.excution mode.com); RapidMiner.init (); Process Process = New Process (New File ("C: \\ User \\ Nellz \\. RapidMiner 5 \ \ Repository \\ Walking Repo \\ NaiveClassify.rmp"); Operator op = processor. Operator ("read CSV"); Op.setParameter (com.rapidminer.operator.nio.CSVExampleSource.PARAMETER_CSV_FILE, "C: \\ User \\ Nell \\ Anilayed (2) .csv"); //ioInput.append(op); IOContainer ioResult = process.run (); ExampleSet resultSet1 = (ExampleSet) ioResult.getElementAt (0); Iterator & lt; Attribute & gt; AllAttributes = resultSet1.getAttributes (). AllAttributes ();   

However, when I run it, it's always called "not defined in the input file."

In my RapidMiner process, the input port reader is connected to the CSV operator

Any help would be appreciated

I think your read CSV is connected to the input port of the operator process (top port of left hand, label inp .) If this is true, the parameter csv file is no longer being used (this should also be hidden in the UI). Instead, the file sent to the input port is used. There are two solutions:

  1. Disconnect the port and set the parameter as you do it in your code.

  2. Keep the ports connected and send the file object to the process, so it goes to read the CSV operator from the input port. Modify your code like this:

      file object file = new SimpleFileObject (new file ("... / unlabeled (2) .csv"); IOContainer input = new IOContainer (file); IOContainer ioResult = process.run (input);      

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -