How to deliver an IOObject to an input port

monami555monami555 Member Posts: 16 Contributor II
edited November 2018 in Help
Hello it's me again.

Maybe someone could advise me on the following issue:

I have a KNN Learner operator which outputs a PredictionModel. I want to store this model object on disk, to be able to use it later, straight from the file, rather than training the model once again.

I am able to serialize and deserialize the PredictionModel object, but now I run into problem: how to pass this model to the ModelApplier operator input port? The most logical it would seem to me to connect the main process inner output with the ModelApplier model input, and then invoke modelApplier.inputPort.deliver(IOObject), but still I get the "No data was delivered at port ModelApplier.model" exception.

In general, what is the right way to deliver an IOObject to an input port?

Best,
M.
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    draw a line from the process input port(s) to the desired operators, and use this code when invoking the process from java:

    IOContainer ioInput = new IOContainer(new IOObject[]{ model });
    IOContainer ioResult = process.run(ioInput);
    Regards,
    Marco
Sign In or Register to comment.