use of org.knime.base.algorithms.outlier.NumericOutliersReviser in project knime-core by knime.
the class NumericOutliersApplyNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
SummaryInternals m_summaryInternals;
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
final NumericOutlierPortObject outlierPort = (NumericOutlierPortObject) ((PortObjectInput) inputs[0]).getPortObject();
NumericOutliersReviser outlierReviser = outlierPort.getOutRevBuilder().build();
outlierReviser.treatOutliers(exec, (RowInput) inputs[1], (RowOutput) outputs[0], outlierPort.getOutlierModel(((RowInput) inputs[1]).getDataTableSpec()));
m_summaryInternals = outlierReviser.getSummaryInternals();
}
/**
* {@inheritDoc}
*/
@Override
public StreamableOperatorInternals saveInternals() {
return m_summaryInternals;
}
};
}
use of org.knime.base.algorithms.outlier.NumericOutliersReviser in project knime-core by knime.
the class NumericOutliersApplyNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inData, final ExecutionContext exec) throws Exception {
final NumericOutlierPortObject outlierPort = (NumericOutlierPortObject) inData[0];
final BufferedDataTable in = (BufferedDataTable) inData[1];
NumericOutliersReviser outlierReviser = outlierPort.getOutRevBuilder().build();
outlierReviser.addListener(this);
final BufferedDataTable outTable = outlierReviser.treatOutliers(exec, in, outlierPort.getOutlierModel(in.getDataTableSpec()));
return new PortObject[] { outTable, outlierReviser.getSummaryTable() };
}
Aggregations