NamedWriteable
, Writeable
, ToXContent
, ToXContentFragment
public class GND extends NXYSignificanceHeuristic
Modifier and Type | Class | Description |
---|---|---|
static class |
GND.GNDBuilder |
NXYSignificanceHeuristic.Frequencies, NXYSignificanceHeuristic.NXYBuilder, NXYSignificanceHeuristic.NXYParser
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
NAME |
|
static SignificanceHeuristicParser |
PARSER |
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGE
EMPTY_PARAMS
Constructor | Description |
---|---|
GND(boolean backgroundIsSuperset) |
|
GND(StreamInput in) |
Read from a stream.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object other) |
|
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
|
java.lang.String |
getWriteableName() |
Returns the name of the writeable object
|
int |
hashCode() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
build, checkFrequencies, computeNxys
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
checkFrequencyValidity, rewrite, rewrite
isFragment
public static final java.lang.String NAME
public static final SignificanceHeuristicParser PARSER
public GND(boolean backgroundIsSuperset)
public GND(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
writeTo
in interface Writeable
writeTo
in class NXYSignificanceHeuristic
java.io.IOException
public boolean equals(java.lang.Object other)
equals
in class NXYSignificanceHeuristic
public int hashCode()
hashCode
in class NXYSignificanceHeuristic
public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
getScore
in class SignificanceHeuristic
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)public java.lang.String getWriteableName()
NamedWriteable
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOException