Class BucketKsAggregation

All Implemented Interfaces:
AggregationVariant, JsonpSerializable

@JsonpDeserializable
public class BucketKsAggregation
extends BucketPathAggregation
implements AggregationVariant
A sibling pipeline aggregation which executes a two sample Kolmogorov–Smirnov test (referred to as a "K-S test" from now on) against a provided distribution, and the distribution implied by the documents counts in the configured sibling aggregation. Specifically, for some metric, assuming that the percentile intervals of the metric are known beforehand or have been computed by an aggregation, then one would use range aggregation for the sibling to compute the p-value of the distribution difference between the metric and the restriction of that metric to a subset of the documents. A natural use case is if the sibling aggregation range aggregation nested in a terms aggregation, in which case one compares the overall distribution of metric to its restriction to each term.
See Also:
API specification
  • Field Details

  • Method Details

    • of

      public static BucketKsAggregation of​(java.util.function.Function<BucketKsAggregation.Builder,​ObjectBuilder<BucketKsAggregation>> fn)
    • _aggregationKind

      public Aggregation.Kind _aggregationKind()
      Aggregation variant kind.
      Specified by:
      _aggregationKind in interface AggregationVariant
    • alternative

      public final java.util.List<java.lang.String> alternative()
      A list of string values indicating which K-S test alternative to calculate. The valid values are: "greater", "less", "two_sided". This parameter is key for determining the K-S statistic used when calculating the K-S test. Default value is all possible alternative hypotheses.

      API name: alternative

    • fractions

      public final java.util.List<java.lang.Double> fractions()
      A list of doubles indicating the distribution of the samples with which to compare to the buckets_path results. In typical usage this is the overall proportion of documents in each bucket, which is compared with the actual document proportions in each bucket from the sibling aggregation counts. The default is to assume that overall documents are uniformly distributed on these buckets, which they would be if one used equal percentiles of a metric to define the bucket end points.

      API name: fractions

    • samplingMethod

      @Nullable public final java.lang.String samplingMethod()
      Indicates the sampling methodology when calculating the K-S test. Note, this is sampling of the returned values. This determines the cumulative distribution function (CDF) points used comparing the two samples. Default is upper_tail, which emphasizes the upper end of the CDF points. Valid options are: upper_tail, uniform, and lower_tail.

      API name: sampling_method

    • serializeInternal

      protected void serializeInternal​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Overrides:
      serializeInternal in class BucketPathAggregation
    • setupBucketKsAggregationDeserializer

      protected static void setupBucketKsAggregationDeserializer​(ObjectDeserializer<BucketKsAggregation.Builder> op)