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
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.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 class
NXYSignificanceHeuristic.Frequencies
protected static class
NXYSignificanceHeuristic.NXYBuilder
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested 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 org.elasticsearch.common.ParseField
BACKGROUND_IS_SUPERSET
protected boolean
backgroundIsSuperset
protected static org.elasticsearch.common.ParseField
INCLUDE_NEGATIVES_FIELD
protected boolean
includeNegatives
Some heuristics do not differentiate between terms that are descriptive for subset or for the background without the subset.protected static java.lang.String
SCORE_ERROR_MESSAGE
-
Constructor Summary
Constructors Modifier Constructor Description protected
NXYSignificanceHeuristic(boolean includeNegatives, boolean backgroundIsSuperset)
protected
NXYSignificanceHeuristic(StreamInput in)
Read from a stream. -
Method Summary
Modifier and Type Method Description protected void
build(org.elasticsearch.common.xcontent.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 void
checkFrequencies(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName)
protected NXYSignificanceHeuristic.Frequencies
computeNxys(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName)
protected static void
declareParseFields(org.elasticsearch.common.xcontent.ConstructingObjectParser<? extends NXYSignificanceHeuristic,?> parser)
Set up and ConstructingObjectParser to accept the standard arguments for an NXYSignificanceHeuristic.boolean
equals(java.lang.Object obj)
int
hashCode()
void
writeTo(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
protected static final org.elasticsearch.common.ParseField BACKGROUND_IS_SUPERSET -
INCLUDE_NEGATIVES_FIELD
protected static final org.elasticsearch.common.ParseField 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:Writeable
Write this into the StreamOutput.- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in 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
protected void build(org.elasticsearch.common.xcontent.XContentBuilder builder) throws java.io.IOException- Throws:
java.io.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> 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.
-