Class ChiSquare
java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.ChiSquare
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
public class ChiSquare extends NXYSignificanceHeuristic
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChiSquare.ChiSquareBuilderNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
NXYSignificanceHeuristic.Frequencies, NXYSignificanceHeuristic.NXYBuilderNested 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.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 static java.lang.StringNAMEstatic org.elasticsearch.common.xcontent.ConstructingObjectParser<ChiSquare,java.lang.Void>PARSERFields inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGE -
Constructor Summary
Constructors Constructor Description ChiSquare(boolean includeNegatives, boolean backgroundIsSuperset)ChiSquare(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object other)doublegetScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)Calculates Chi^2 see "Information Retrieval", Manning et al., Eq.java.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
build, buildFromParsedArgs, checkFrequencies, computeNxys, declareParseFields, writeToMethods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
checkFrequencyValidity, rewrite, rewrite
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
PARSER
public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<ChiSquare,java.lang.Void> PARSER
-
-
Constructor Details
-
Method Details
-
equals
public boolean equals(java.lang.Object other)- Overrides:
equalsin classNXYSignificanceHeuristic
-
hashCode
public int hashCode()- Overrides:
hashCodein classNXYSignificanceHeuristic
-
getScore
public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)Calculates Chi^2 see "Information Retrieval", Manning et al., Eq. 13.19- Specified by:
getScorein classSignificanceHeuristic- Parameters:
subsetFreq- The frequency of the term in the selected samplesubsetSize- The size of the selected sample (typically number of docs)supersetFreq- The frequency of the term in the superset from which the sample was takensupersetSize- The size of the superset from which the sample was taken (typically number of docs)- Returns:
- a "significance" score
-
getWriteableName
public java.lang.String getWriteableName()Description copied from interface:NamedWriteableReturns the name of the writeable object -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-