Class NXYSignificanceHeuristic
java.lang.Object
org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.significant.heuristics.NXYSignificanceHeuristic
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
- Direct Known Subclasses:
ChiSquare,GND,MutualInformation
public abstract class NXYSignificanceHeuristic extends SignificanceHeuristic
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classNXYSignificanceHeuristic.Frequenciesprotected static classNXYSignificanceHeuristic.NXYBuilderNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description protected static ParseFieldBACKGROUND_IS_SUPERSETprotected booleanbackgroundIsSupersetprotected static ParseFieldINCLUDE_NEGATIVES_FIELDprotected booleanincludeNegativesSome heuristics do not differentiate between terms that are descriptive for subset or for the background without the subset.protected static java.lang.StringSCORE_ERROR_MESSAGE -
Constructor Summary
Constructors Modifier Constructor Description protectedNXYSignificanceHeuristic(boolean includeNegatives, boolean backgroundIsSuperset)protectedNXYSignificanceHeuristic(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description protected voidbuild(XContentBuilder builder)protected static <T> java.util.function.Function<java.lang.Object[],T>buildFromParsedArgs(java.util.function.BiFunction<java.lang.Boolean,java.lang.Boolean,T> ctor)Adapt a standard two argument ctor into one that consumes a ConstructingObjectParser's fields.protected voidcheckFrequencies(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName)protected NXYSignificanceHeuristic.FrequenciescomputeNxys(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName)protected static voiddeclareParseFields(ConstructingObjectParser<? extends NXYSignificanceHeuristic,?> parser)Set up and ConstructingObjectParser to accept the standard arguments for an NXYSignificanceHeuristic.booleanequals(java.lang.Object obj)inthashCode()voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic
checkFrequencyValidity, getScore, rewrite, rewrite
-
Field Details
-
BACKGROUND_IS_SUPERSET
-
INCLUDE_NEGATIVES_FIELD
-
SCORE_ERROR_MESSAGE
protected static final java.lang.String SCORE_ERROR_MESSAGE -
backgroundIsSuperset
protected final boolean backgroundIsSuperset -
includeNegatives
protected final boolean includeNegativesSome 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
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
computeNxys
protected NXYSignificanceHeuristic.Frequencies computeNxys(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName) -
checkFrequencies
protected void checkFrequencies(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName) -
build
- Throws:
java.io.IOException
-
declareParseFields
protected static void declareParseFields(ConstructingObjectParser<? extends NXYSignificanceHeuristic,?> parser)Set up and ConstructingObjectParser to accept the standard arguments for an NXYSignificanceHeuristic. -
buildFromParsedArgs
protected static <T> java.util.function.Function<java.lang.Object[],T> buildFromParsedArgs(java.util.function.BiFunction<java.lang.Boolean,java.lang.Boolean,T> ctor)Adapt a standard two argument ctor into one that consumes a ConstructingObjectParser's fields.
-