Module org.elasticsearch.xcore
Interface OutputAggregator
- All Superinterfaces:
org.apache.lucene.util.Accountable,NamedWriteable,NamedXContentObject,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptiondoubleaggregate(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.booleancompatibleWith(TargetType targetType) getName()double[]processValues(double[][] values) This pre-processes the values so that they may be passed directly to theaggregate(double[])method.Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContentMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
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 theaggregate(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:
getNamein interfaceNamedXContentObject- Returns:
- The name of the output aggregator
-
compatibleWith
-