Search in sources :

Example 1 with SummaryInternals

use of org.knime.base.algorithms.outlier.NumericOutliersReviser.SummaryInternals 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;
        }
    };
}
Also used : ExecutionContext(org.knime.core.node.ExecutionContext) NumericOutlierPortObject(org.knime.base.algorithms.outlier.NumericOutlierPortObject) SummaryInternals(org.knime.base.algorithms.outlier.NumericOutliersReviser.SummaryInternals) NumericOutliersReviser(org.knime.base.algorithms.outlier.NumericOutliersReviser) StreamableOperator(org.knime.core.node.streamable.StreamableOperator) RowInput(org.knime.core.node.streamable.RowInput)

Example 2 with SummaryInternals

use of org.knime.base.algorithms.outlier.NumericOutliersReviser.SummaryInternals in project knime-core by knime.

the class NumericOutliersApplyNodeModel method finishStreamableExecution.

/**
 * {@inheritDoc}
 */
@Override
public void finishStreamableExecution(final StreamableOperatorInternals internals, final ExecutionContext exec, final PortOutput[] output) throws Exception {
    SummaryInternals sumInt = ((NumericOutliersReviser.SummaryInternals) internals);
    sumInt.writeTable(exec, (RowOutput) output[1]);
    for (final String warning : sumInt.getWarnings()) {
        setWarningMessage(warning);
    }
}
Also used : SummaryInternals(org.knime.base.algorithms.outlier.NumericOutliersReviser.SummaryInternals) NumericOutliersReviser(org.knime.base.algorithms.outlier.NumericOutliersReviser)

Aggregations

NumericOutliersReviser (org.knime.base.algorithms.outlier.NumericOutliersReviser)2 SummaryInternals (org.knime.base.algorithms.outlier.NumericOutliersReviser.SummaryInternals)2 NumericOutlierPortObject (org.knime.base.algorithms.outlier.NumericOutlierPortObject)1 ExecutionContext (org.knime.core.node.ExecutionContext)1 RowInput (org.knime.core.node.streamable.RowInput)1 StreamableOperator (org.knime.core.node.streamable.StreamableOperator)1