use of org.knime.core.node.port.pmml.preproc.PMMLPreprocPortObject in project knime-core by knime.
the class AutoBinnerApplyNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec) throws Exception {
PMMLPreprocPortObject pmmlPort = (PMMLPreprocPortObject) inObjects[0];
BufferedDataTable inTable = (BufferedDataTable) inObjects[1];
validatePMMLPort(pmmlPort);
PMMLPreprocDiscretize op = (PMMLPreprocDiscretize) pmmlPort.getOperations().get(0);
AutoBinnerApply applier = new AutoBinnerApply();
BufferedDataTable binnedData = applier.execute(op, inTable, exec);
return new PortObject[] { binnedData };
}
use of org.knime.core.node.port.pmml.preproc.PMMLPreprocPortObject in project knime-core by knime.
the class AutoBinnerApplyNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
PMMLPreprocPortObject pmmlPort = (PMMLPreprocPortObject) ((PortObjectInput) inputs[0]).getPortObject();
validatePMMLPort(pmmlPort);
PMMLPreprocDiscretize op = (PMMLPreprocDiscretize) pmmlPort.getOperations().get(0);
AutoBinnerApply applier = new AutoBinnerApply();
ColumnRearranger core = applier.getRearranger(op, (DataTableSpec) inSpecs[1]);
StreamableFunction func = core.createStreamableFunction(1, 0);
func.runFinal(inputs, outputs, exec);
}
};
}
Aggregations