use of org.knime.base.data.normalize.NormalizerPortObject in project knime-core by knime.
the class NormalizerNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec) throws Exception {
CalculationResult result = calculate(inObjects, exec);
NormalizerPortObject p = new NormalizerPortObject(result.getSpec(), result.getConfig());
return new PortObject[] { result.getDataTable(), p };
}
use of org.knime.base.data.normalize.NormalizerPortObject in project knime-core by knime.
the class NormalizerApplyNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inData, final ExecutionContext exec) throws Exception {
NormalizerPortObject model = (NormalizerPortObject) inData[0];
BufferedDataTable table = (BufferedDataTable) inData[1];
AffineTransTable t = new AffineTransTable(table, getAffineTrans(model.getConfiguration()));
BufferedDataTable bdt = exec.createBufferedDataTable(t, exec);
if (t.getErrorMessage() != null) {
setWarningMessage(t.getErrorMessage());
}
return new BufferedDataTable[] { bdt };
}
use of org.knime.base.data.normalize.NormalizerPortObject in project knime-core by knime.
the class Normalizer3NodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec) throws Exception {
CalculationResult result = calculate(inObjects, exec);
NormalizerPortObject p = new NormalizerPortObject(result.getSpec(), result.getConfig());
return new PortObject[] { result.getDataTable(), p };
}
use of org.knime.base.data.normalize.NormalizerPortObject in project knime-core by knime.
the class Normalizer2NodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec) throws Exception {
CalculationResult result = calculate(inObjects, exec);
NormalizerPortObject p = new NormalizerPortObject(result.getSpec(), result.getConfig());
return new PortObject[] { result.getDataTable(), p };
}
use of org.knime.base.data.normalize.NormalizerPortObject in project knime-core by knime.
the class NormalizerApplyNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
if (getNrOutPorts() == 2) {
// by default call the default implementation of this method
return super.createStreamableOperator(partitionInfo, inSpecs);
} else {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
assert outputs.length == 1;
NormalizerPortObject model = (NormalizerPortObject) ((PortObjectInput) inputs[0]).getPortObject();
RowInput rowInput = (RowInput) inputs[1];
AffineTransTable t = new AffineTransTable(rowInput, getAffineTrans(model.getConfiguration()));
RowOutput rowOutput = (RowOutput) outputs[0];
RowIterator it = t.iterator();
while (it.hasNext()) {
rowOutput.push(it.next());
}
if (t.getErrorMessage() != null) {
// TODO collect error message from remote nodes if run distributed
setWarningMessage(t.getErrorMessage());
}
rowInput.close();
rowOutput.close();
}
};
}
}
Aggregations