Options

CSVDataReader and Operator.apply method Issues

jaysonprydejaysonpryde Member Posts: 20 Contributor II
edited November 2018 in Help
Good day,

I'm new to rapidMiner/rapidMiner development. I am currently creating a java application that does simple classification.
However, i am encountering 2 issues inhibiting me to proceed to further development:

1. [CSVDataReader]: No operator description object given for 'com.rapidminer.operator.io.CSVDataReader'
    - I am receiving the said exception when I ran this code snippet:
       
Operator unlabeled = OperatorService.createOperator(CSVDataReader.class);
2. Operator.apply method is already deprecated
   
unlabeled.apply(new IOContainer());
    - as stated, .apply method of Operator object is deprecated. Are there any replacement(s) for this. Currently, I am doing it the long way.
      That is,

     

Process csvProcess = new Process();
csvProcess.getRootOperator().addOperator(unlabeled, 0);
IOContainer c = csvProcess.run();
ExampleSet es = c.get(ExampleSet.class);
Hoping to hear any feedback from you guys. Thank you
Tagged:

Answers

  • Options
    jaysonprydejaysonpryde Member Posts: 20 Contributor II
    Hi All,

        I was able to address the 2 issues i've posted. The first one was resolved correcting the import (import com.rapidminer.operator.nio.CSVExampleSource instead of import com.rapidminer.operator.io.CSVExampleSource).

    For the 2nd one, I am now using doWork() method. However, this returns void.
    How will I be able to put the result of this to an IOContainer object? Casting it is not permitted

    Hoping to hear feedback from you guys. Any help is greatly appreciated. Thank you
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    I will suggest what I always suggest when these kind of questions pop up :)
    Use RapidMiner to create your processes via the GUI, and then just execute them via java code. That way is a) easier and b) much less error-prone.
    To see how this could be done, check here.

    Regards,
    Marco
  • Options
    jaysonprydejaysonpryde Member Posts: 20 Contributor II
    Thank you very much for the input. Really really appreciate it.  :)
Sign In or Register to comment.