Testing the data set against model.
I was able to generate the model by applying the operators programmitically. But I am facing difficulty in testing the dataset against the model. The test data and the train data set are in the format of csv.
Below is the sample code, could you please tell me what I am doing wrong asap?
Operator csvReader1 = OperatorService.createOperator(CSVExampleSource.class);
csvReader1.setParameter(CSVExampleSource.PARAMETER_CSV_FILE, "E://Rapid//RapidRepository//classification//classification_data_test_set.csv");
csvReader1.setParameter(CSVExampleSource.PARAMETER_COLUMN_SEPARATORS, ",");
csvReader1.setParameter(CSVExampleSource.PARAMETER_TRIM_LINES, "true");
csvReader1.setParameter(CSVExampleSource.PARAMETER_FIRST_ROW_AS_NAMES, "true");
csvReader1.setParameter(CSVExampleSource.PARAMETER_META_DATA, metaData);
Operator ReadModelOperator = OperatorService.createOperator(ModelLoader.class);
ReadModelOperator.setParameter("model_file", "E://Rapid//RapidRepository//classification//class.model");
Operator modelApplier = OperatorService.createOperator(ModelApplier.class);
modelApplier.setParameter("keep_model", "false");
csvReader1.getOutputPorts().getPortByName("output").connectTo(modelApplier.getInputPorts().getPortByName("unlabelled data"));
ReadModelOperator.getOutputPorts().getPortByName("output").connectTo(modelApplier.getInputPorts().getPortByName("model"));
Process process1 = new Process();
process1.getRootOperator().getSubprocess(0).addOperator(csvReader1);
process1.getRootOperator().getSubprocess(0).addOperator(ReadModelOperator);
process1.getRootOperator().getSubprocess(0).addOperator(modelApplier);
ExampleSet resultSet = process1.run().get(ExampleSet.class);
Below is the exception
Exception in thread "main" com.rapidminer.operator.MissingIOObjectException: The operator needs some input of type com.rapidminer.example.ExampleSet which is not provided.
at com.rapidminer.operator.IOContainer.getInput(IOContainer.java:185)
at com.rapidminer.operator.IOContainer.get(IOContainer.java:129)
Below is the sample code, could you please tell me what I am doing wrong asap?
Operator csvReader1 = OperatorService.createOperator(CSVExampleSource.class);
csvReader1.setParameter(CSVExampleSource.PARAMETER_CSV_FILE, "E://Rapid//RapidRepository//classification//classification_data_test_set.csv");
csvReader1.setParameter(CSVExampleSource.PARAMETER_COLUMN_SEPARATORS, ",");
csvReader1.setParameter(CSVExampleSource.PARAMETER_TRIM_LINES, "true");
csvReader1.setParameter(CSVExampleSource.PARAMETER_FIRST_ROW_AS_NAMES, "true");
csvReader1.setParameter(CSVExampleSource.PARAMETER_META_DATA, metaData);
Operator ReadModelOperator = OperatorService.createOperator(ModelLoader.class);
ReadModelOperator.setParameter("model_file", "E://Rapid//RapidRepository//classification//class.model");
Operator modelApplier = OperatorService.createOperator(ModelApplier.class);
modelApplier.setParameter("keep_model", "false");
csvReader1.getOutputPorts().getPortByName("output").connectTo(modelApplier.getInputPorts().getPortByName("unlabelled data"));
ReadModelOperator.getOutputPorts().getPortByName("output").connectTo(modelApplier.getInputPorts().getPortByName("model"));
Process process1 = new Process();
process1.getRootOperator().getSubprocess(0).addOperator(csvReader1);
process1.getRootOperator().getSubprocess(0).addOperator(ReadModelOperator);
process1.getRootOperator().getSubprocess(0).addOperator(modelApplier);
ExampleSet resultSet = process1.run().get(ExampleSet.class);
Below is the exception
Exception in thread "main" com.rapidminer.operator.MissingIOObjectException: The operator needs some input of type com.rapidminer.example.ExampleSet which is not provided.
at com.rapidminer.operator.IOContainer.getInput(IOContainer.java:185)
at com.rapidminer.operator.IOContainer.get(IOContainer.java:129)
Find more posts tagged with
Sort by:
1 - 6 of
61

Does your process needs input? Because it seems you have not provided any ExampleSets for your run method.
Hi,
is there any particular reason why you are using the much more error-prone approach of constructing the process programatically instead of using one you created via the GUI as described here?
Regards,
Marco
is there any particular reason why you are using the much more error-prone approach of constructing the process programatically instead of using one you created via the GUI as described here?
Regards,
Marco
Sorry, I have not realized the problem previously. I suspect it is related to the fact that you did not connected anything to the process output, although you expected some. (It might help debugging if you save the process and load it with the GUI.)
Hope this helps (and this time I made a better conclusion
), gabor
Hope this helps (and this time I made a better conclusion

I am trying to achieve the following
- I have an process (rmp file) created through GUI, which has all the required operators chained.
- When I've feeded to the process and ran, it created the required output that I am looking for.
- Now, I have a model and the test data which I want to test against the model.
Could you please let me know what is the best approach for the 3rd step to be achieved?
Thanks,
- I have an process (rmp file) created through GUI, which has all the required operators chained.
- When I've feeded to the process and ran, it created the required output that I am looking for.
- Now, I have a model and the test data which I want to test against the model.
Could you please let me know what is the best approach for the 3rd step to be achieved?
Thanks,