public class TestReal extends Object
Classifier
against an oracle
Classifier
on the objects returned from a Parser
, with different statistical
metrics.
In particular, this class is for real
type, i.e. regression. For discrete
type,
refer class TestDiscrete
.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.math3.stat.descriptive.DescriptiveStatistics |
goldStats |
protected org.apache.commons.math3.stat.descriptive.DescriptiveStatistics |
goldSubtractPredictionAbsoluteStats |
protected org.apache.commons.math3.stat.descriptive.DescriptiveStatistics |
goldSubtractPredictionStats |
protected double |
sumOfSquareOfGoldSubtractPrediction |
Constructor and Description |
---|
TestReal() |
Modifier and Type | Method and Description |
---|---|
void |
printPerformace(PrintStream out,
int processed)
Write to PrintStream, with statistical information
|
void |
reportPrediction(double prediction,
double gold)
Update internal book keeping of each prediction and gold
|
static void |
testReal(TestReal tester,
Classifier classifier,
Classifier oracle,
Parser parser,
boolean output,
int outputGranularity)
Tests the given
real classifier against the given oracle using the given
Parser to provide the real labeled testing data. |
protected double sumOfSquareOfGoldSubtractPrediction
protected org.apache.commons.math3.stat.descriptive.DescriptiveStatistics goldSubtractPredictionStats
protected org.apache.commons.math3.stat.descriptive.DescriptiveStatistics goldSubtractPredictionAbsoluteStats
protected org.apache.commons.math3.stat.descriptive.DescriptiveStatistics goldStats
public static void testReal(TestReal tester, Classifier classifier, Classifier oracle, Parser parser, boolean output, int outputGranularity)
real
classifier against the given oracle using the given
Parser
to provide the real
labeled testing data.
This method uses root-mean-square error as the evaluation criteria.tester
- An object of this classclassifier
- The classifier to be tested.oracle
- The classifier to test against.parser
- The parser supplying the labeled example objects.output
- Whether or not to produce output on stdout
.outputGranularity
- The number of examples processed in between time stamp messages.public void reportPrediction(double prediction, double gold)
prediction
- prediction valuegold
- gold valuepublic void printPerformace(PrintStream out, int processed)
out
- printstreamprocessed
- number of testing examplesCopyright © 2016. All rights reserved.