Module org.elasticsearch.server
Class GND
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.GND
- 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.Frequencies, NXYSignificanceHeuristic.NXYBuilder
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final ConstructingObjectParser<GND,
Void> Fields inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGE
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.pdfReturns the name of the writeable objectint
hashCode()
toXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic
build, buildFromParsedArgs, checkFrequencies, computeNxys, declareParseFields
Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
checkFrequencyValidity, rewrite, rewrite
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
PARSER
-
-
Constructor Details
-
GND
public GND(boolean backgroundIsSuperset) -
GND
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classNXYSignificanceHeuristic
- Throws:
IOException
-
equals
- Overrides:
equals
in classNXYSignificanceHeuristic
-
hashCode
public int hashCode()- Overrides:
hashCode
in 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:
getScore
in 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:NamedWriteable
Returns the name of the writeable object -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-