🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

"Get output ExampleSet error!"

User: "hotae"
New Altair Community Member
Updated by Jocelyn
Hi,
I want to import a csv file as a ExampleSet using CSVExampleSource, so I code sa:
RapidMiner.init();
Operator trainingDataReader = OperatorService.createOperator(CSVExampleSource.class);
            trainingDataReader.setParameter(CSVExampleSource.PARAMETER_CSV_FILE, "C:/Documents and Settings/tmd/data/data_forPrediction.csv");
            trainingDataReader.setParameter(CSVExampleSource.PARAMETER_COLUMN_SEPARATORS, "\t");
            trainingDataReader.setParameter(CSVExampleSource.PARAMETER_TRIM_LINES, "true");
            trainingDataReader.setParameter(CSVExampleSource.PARAMETER_FIRST_ROW_AS_NAMES, "true");
            Process process = new Process();
            //add operators to process
            process.getRootOperator().getSubprocess(0).addOperator(trainingDataReader);
            IOContainer ioResult = process.run();
            ExampleSet exampleSet = (ExampleSet) ioResult.getElementAt(0);
But I got the following error:
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:604)
at java.util.ArrayList.get(ArrayList.java:382)
at com.rapidminer.operator.IOContainer.getElementAt(IOContainer.java:112)
It seems nothing output by process.run();
Any one tell me how to do?
Thanks!

Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "aborg"
    New Altair Community Member
    It seems you forget to connect the output to the Process' port. I guess after fixing that you will be ok.
    User: "hotae"
    New Altair Community Member
    OP
    aborg wrote:

    It seems you forget to connect the output to the Process' port. I guess after fixing that you will be ok.
    Could you give me a hint to set it? I don't know how to connect the output to the process's port

    Thank you!
    User: "aborg"
    New Altair Community Member
    Sorry, I have no out ot the box working example. Something along the following lines might help (not tested):

    final ProcessRootOperator rootOp = process.getRootOperator();
    final ExecutionUnit executionUnit = rootOp.getSubprocess(0);
    int i = 0;
    for (final OutputPort outPort : newOp.getOutputPorts().getAllPorts()) {
      final InputPort inputPort = executionUnit.getInnerSinks().getPortByIndex(i++);
      outPort.connectTo(inputPort);
    }
    User: "hotae"
    New Altair Community Member
    OP
    It's works! Thanks!