Search in sources :

Example 1 with PSquarePercentileOperator

use of org.knime.base.data.aggregation.numerical.PSquarePercentileOperator in project knime-core by knime.

the class NumericOutliersIntervalsCalculator method getAggretators.

/**
 * Creates column aggregators for each of the outlier columns.
 *
 * @param inSpec the input data table spec
 * @param gSettings the global settings
 * @return an array of column aggregators
 */
private ColumnAggregator[] getAggretators(final DataTableSpec inSpec, final GlobalSettings gSettings) {
    final ColumnAggregator[] aggregators = new ColumnAggregator[m_outlierColNames.length * 2];
    int pos = 0;
    // for each outlier column name create the aggregators
    for (final String outlierColName : m_outlierColNames) {
        // the operator column settings
        final OperatorColumnSettings cSettings = new OperatorColumnSettings(INCL_MISSING_CELLS, inSpec.getColumnSpec(outlierColName));
        // setting
        for (final double percentile : PERCENTILES) {
            final AggregationMethod method;
            if (m_useHeuristic) {
                method = new PSquarePercentileOperator(gSettings, cSettings, 100 * percentile);
            } else {
                method = new QuantileOperator(new OperatorData("Quantile", true, false, DoubleValue.class, INCL_MISSING_CELLS), gSettings, cSettings, percentile, m_estimationType.name());
            }
            aggregators[pos++] = new ColumnAggregator(cSettings.getOriginalColSpec(), method);
        }
    }
    // return the aggregators
    return aggregators;
}
Also used : AggregationMethod(org.knime.base.data.aggregation.AggregationMethod) PSquarePercentileOperator(org.knime.base.data.aggregation.numerical.PSquarePercentileOperator) QuantileOperator(org.knime.base.data.aggregation.numerical.QuantileOperator) ColumnAggregator(org.knime.base.data.aggregation.ColumnAggregator) OperatorColumnSettings(org.knime.base.data.aggregation.OperatorColumnSettings) OperatorData(org.knime.base.data.aggregation.OperatorData)

Aggregations

AggregationMethod (org.knime.base.data.aggregation.AggregationMethod)1 ColumnAggregator (org.knime.base.data.aggregation.ColumnAggregator)1 OperatorColumnSettings (org.knime.base.data.aggregation.OperatorColumnSettings)1 OperatorData (org.knime.base.data.aggregation.OperatorData)1 PSquarePercentileOperator (org.knime.base.data.aggregation.numerical.PSquarePercentileOperator)1 QuantileOperator (org.knime.base.data.aggregation.numerical.QuantileOperator)1