CSVDataReader and Operator.apply method Issues
jaysonpryde
New Altair Community Member
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:
That is,
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,
Hoping to hear any feedback from you guys. Thank you
Process csvProcess = new Process();
csvProcess.getRootOperator().addOperator(unlabeled, 0);
IOContainer c = csvProcess.run();
ExampleSet es = c.get(ExampleSet.class);
0
Answers
-
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 you0 -
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,
Marco0 -
Thank you very much for the input. Really really appreciate it.0