Class NXYSignificanceHeuristic

java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment
Direct Known Subclasses:
ChiSquare, GND, MutualInformation

public abstract class NXYSignificanceHeuristic extends SignificanceHeuristic
  • Field Details

    • BACKGROUND_IS_SUPERSET

      protected static final org.elasticsearch.common.xcontent.ParseField BACKGROUND_IS_SUPERSET
    • INCLUDE_NEGATIVES_FIELD

      protected static final org.elasticsearch.common.xcontent.ParseField INCLUDE_NEGATIVES_FIELD
    • SCORE_ERROR_MESSAGE

      protected static final String SCORE_ERROR_MESSAGE
    • backgroundIsSuperset

      protected final boolean backgroundIsSuperset
    • includeNegatives

      protected final boolean includeNegatives
      Some heuristics do not differentiate between terms that are descriptive for subset or for the background without the subset. We might want to filter out the terms that are appear much less often in the subset than in the background without the subset.
  • Constructor Details

    • NXYSignificanceHeuristic

      protected NXYSignificanceHeuristic(boolean includeNegatives, boolean backgroundIsSuperset)
    • NXYSignificanceHeuristic

      protected NXYSignificanceHeuristic(StreamInput in) throws IOException
      Read from a stream.
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Throws:
      IOException
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • computeNxys

      protected NXYSignificanceHeuristic.Frequencies computeNxys(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, String scoreFunctionName)
    • checkFrequencies

      protected void checkFrequencies(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, String scoreFunctionName)
    • build

      protected void build(org.elasticsearch.common.xcontent.XContentBuilder builder) throws IOException
      Throws:
      IOException
    • declareParseFields

      protected static void declareParseFields(org.elasticsearch.common.xcontent.ConstructingObjectParser<? extends NXYSignificanceHeuristic,​?> parser)
      Set up and ConstructingObjectParser to accept the standard arguments for an NXYSignificanceHeuristic.
    • buildFromParsedArgs

      protected static <T> Function<Object[],​T> buildFromParsedArgs(BiFunction<Boolean,​Boolean,​T> ctor)
      Adapt a standard two argument ctor into one that consumes a ConstructingObjectParser's fields.