public class NumericStatsCollector extends MinMaxStatsCollector
NumericStatsCollector
computes the sum, sum of squares, mean and standard deviation.Modifier and Type | Field and Description |
---|---|
protected double |
mean |
protected double |
stddev |
protected double |
sum |
protected double |
sumOfSquares |
function, max, min, missingCount, source, statsList, value, valueCount, valueFiller
Constructor and Description |
---|
NumericStatsCollector(ValueSource source,
Set<String> statsList) |
Modifier and Type | Method and Description |
---|---|
void |
collect(int doc)
Collect values from the value source and add to statistics.
|
void |
compute()
After all documents have been collected, this method should be
called to finalize the calculations of each statistic.
|
Comparable |
getStat(String stat)
Return the value of the given statistic.
|
getFunction, getStatsList, getValue, setNextReader, statString, toString, valueSourceString
protected double sum
protected double sumOfSquares
protected double mean
protected double stddev
public NumericStatsCollector(ValueSource source, Set<String> statsList)
public void collect(int doc)
StatsCollector
collect
in interface StatsCollector
collect
in class MinMaxStatsCollector
doc
- Document to collect frompublic Comparable getStat(String stat)
StatsCollector
getStat
in interface StatsCollector
getStat
in class MinMaxStatsCollector
stat
- the statpublic void compute()
StatsCollector
compute
in interface StatsCollector
compute
in class MinMaxStatsCollector
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.