Altair RISE
A program to recognize and reward our most engaged community members
Nominate Yourself Now!
Home
Discussions
Community Q&A
"Connecting ports between CSV Data Reader and Apply Model operators in Java"
leonardormachad
Hello.
Using RapidMiner 5 IDE, I'm able to connect the "output" port of a Read CSV operator to the "unlabelled data" input port of an Apply Model Operator, and it works fine.
However, in Java, I'm receiving the follow exception message when trying to connect these ports:
"Exception in thread "AWT-EventQueue-0" com.rapidminer.operator.ports.impl.CannotConnectPortException: Cannot connect Read CSV.output to Apply Model.unlabelled data"
My Java code is the following:
com.rapidminer.Process processo = new com.rapidminer.Process();
leitorCSV = OperatorService.createOperator(CSVDataReader.class);
leitorCSV.setParameter("file_name",nomeArquivoNormalizado);
leitorCSV.setParameter("column_separators",""");
leitorCSV.setParameter("trim_lines","true");
leitorCSV.setParameter("use_first_row_as_attribute_names", "true");
leitorCSV.setParameter("attribute_names_already_defined", "true");
OutputPort portaSaidaLeitorCSV = leitorCSV.getOutputPorts().getPortByName("output");
carregadorModelo = OperatorService.createOperator(ModelLoader.class);
carregadorModelo.setParameter("model_file", this.getCaminhoArquivoClassificador());
OutputPort portaSaidaCarregadorModelo = leitorCSV.getOutputPorts().getPortByName("output");
aplicadorModelo = OperatorService.createOperator(ModelApplier.class);
InputPort portaEntrada1AplicadorModelo = aplicadorModelo.getInputPorts().getPortByName("model");
InputPort portaEntrada2AplicadorModelo = aplicadorModelo.getInputPorts().getPortByName("unlabelled data");
portaSaidaCarregadorModelo.connectTo(portaEntrada1AplicadorModelo);
portaSaidaLeitorCSV.connectTo(portaEntrada2AplicadorModelo);
Last line is throwing the exception...
Could somebody help me, please?
Thanks in advance!
Leonardo
Find more posts tagged with
AI Studio
CSV
Java
Accepted answers
All comments
leonardormachad
Solved.
Both output ports were being created from the same operator (leitorCSV).
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Groups