All Superinterfaces:
org.apache.lucene.util.Accountable, NamedWriteable, NamedXContentObject, ToXContent, ToXContentObject, Writeable
All Known Subinterfaces:
LenientlyParsedOutputAggregator, StrictlyParsedOutputAggregator
All Known Implementing Classes:
Exponent, LogisticRegression, WeightedMode, WeightedSum

public interface OutputAggregator extends NamedXContentObject, NamedWriteable, org.apache.lucene.util.Accountable
  • Method Details

    • expectedValueSize

      Integer expectedValueSize()
      Returns:
      The expected size of the values array when aggregating. `null` implies there is no expected size.
    • processValues

      double[] processValues(double[][] values)
      This pre-processes the values so that they may be passed directly to the aggregate(double[]) method. Two major types of pre-processed values could be returned: - The confidence/probability scaled values given the input values (See: WeightedMode.processValues(double[][]) - A simple transformation of the passed values in preparation for aggregation (See: WeightedSum.processValues(double[][])
      Parameters:
      values - the values to process
      Returns:
      A new list containing the processed values or the same list if no processing is required
    • aggregate

      double aggregate(double[] processedValues)
      Function to aggregate the processed values into a single double This may be as simple as returning the index of the maximum value. Or as complex as a mathematical reduction of all the passed values (i.e. summation, average, etc.).
      Parameters:
      processedValues - The values to aggregate
      Returns:
      the aggregated value.
    • getName

      String getName()
      Specified by:
      getName in interface NamedXContentObject
      Returns:
      The name of the output aggregator
    • compatibleWith

      boolean compatibleWith(TargetType targetType)