public class ChiSquare extends NXYSignificanceHeuristic
Modifier and Type | Class and Description |
---|---|
static class |
ChiSquare.ChiSquareBuilder |
NXYSignificanceHeuristic.Frequencies, NXYSignificanceHeuristic.NXYBuilder, NXYSignificanceHeuristic.NXYParser
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
static SignificanceHeuristicParser |
PARSER |
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGE
EMPTY_PARAMS
Constructor and Description |
---|
ChiSquare(boolean includeNegatives,
boolean backgroundIsSuperset) |
ChiSquare(StreamInput in)
Read from a stream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
double |
getScore(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize)
Calculates Chi^2
see "Information Retrieval", Manning et al., Eq.
|
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
int |
hashCode() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
build, checkFrequencies, computeNxys, writeTo
checkFrequencyValidity, initialize, initialize
public static final java.lang.String NAME
public static final SignificanceHeuristicParser PARSER
public ChiSquare(boolean includeNegatives, boolean backgroundIsSuperset)
public ChiSquare(StreamInput in) throws java.io.IOException
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