Module org.elasticsearch.server
Class MutualInformation
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.MutualInformation
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
NXYSignificanceHeuristic.FrequenciesNested classes/interfaces inherited from interface org.elasticsearch.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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ConstructingObjectParser<MutualInformation, Void> Fields inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGEFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionMutualInformation(boolean includeNegatives, boolean backgroundIsSuperset) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoublegetScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Calculates mutual information see "Information Retrieval", Manning et al., Eq.Returns the name of the writeable objectinthashCode()toXContent(XContentBuilder builder, 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, rewriteMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
PARSER
-
-
Constructor Details
-
MutualInformation
public MutualInformation(boolean includeNegatives, boolean backgroundIsSuperset) -
MutualInformation
Read from a stream.- Throws:
IOException
-
-
Method Details
-
equals
- Overrides:
equalsin classNXYSignificanceHeuristic
-
hashCode
public int hashCode()- Overrides:
hashCodein classNXYSignificanceHeuristic
-
getScore
public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Calculates mutual information see "Information Retrieval", Manning et al., Eq. 13.17- 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
Description copied from interface:NamedWriteableReturns the name of the writeable object -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-