Class GND
java.lang.Object
org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.significant.heuristics.NXYSignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.significant.heuristics.GND
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
public class GND extends NXYSignificanceHeuristic
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGND.GNDBuilderNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.significant.heuristics.NXYSignificanceHeuristic
NXYSignificanceHeuristic.Frequencies, NXYSignificanceHeuristic.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 static java.lang.StringNAMEstatic ConstructingObjectParser<GND,java.lang.Void>PARSERFields inherited from class org.elasticsearch.search.aggregations.bucket.significant.heuristics.NXYSignificanceHeuristic
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGE -
Constructor Summary
Constructors Constructor Description GND(boolean backgroundIsSuperset)GND(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 Google Normalized Distance, as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007 link: http://arxiv.org/pdf/cs/0412098v3.pdfjava.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.bucket.significant.heuristics.NXYSignificanceHeuristic
build, buildFromParsedArgs, checkFrequencies, computeNxys, declareParseFieldsMethods inherited from class org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic
checkFrequencyValidity, rewrite, rewrite
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
PARSER
-
-
Constructor Details
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classNXYSignificanceHeuristic- Throws:
java.io.IOException
-
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 Google Normalized Distance, as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007 link: http://arxiv.org/pdf/cs/0412098v3.pdf- 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 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-