public class ChiSquare extends NXYSignificanceHeuristic
Modifier and Type | Class and Description |
---|---|
static class |
ChiSquare.ChiSquareBuilder |
static class |
ChiSquare.ChiSquareParser |
NXYSignificanceHeuristic.Frequencies, NXYSignificanceHeuristic.NXYBuilder, NXYSignificanceHeuristic.NXYParser
Modifier and Type | Field and Description |
---|---|
protected static ParseField |
NAMES_FIELD |
static SignificanceHeuristicStreams.Stream |
STREAM |
BACKGROUND_IS_SUPERSET, backgroundIsSuperset, INCLUDE_NEGATIVES_FIELD, includeNegatives, SCORE_ERROR_MESSAGE
Constructor and Description |
---|
ChiSquare(boolean includeNegatives,
boolean backgroundIsSuperset) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
double |
getScore(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize)
Calculates Chi^2
see "Information Retrieval", Manning et al., Eq.
|
int |
hashCode() |
void |
writeTo(StreamOutput out) |
checkFrequencies, computeNxys
checkFrequencyValidity, initialize
protected static final ParseField NAMES_FIELD
public static final SignificanceHeuristicStreams.Stream STREAM
public ChiSquare(boolean includeNegatives, boolean backgroundIsSuperset)
public boolean equals(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 void writeTo(StreamOutput out) throws IOException
writeTo
in class NXYSignificanceHeuristic
IOException
Copyright © 2009–2016. All rights reserved.