Class Statistics

  • All Implemented Interfaces:
    org.apache.hadoop.io.Writable

    public final class Statistics
    extends java.lang.Object
    implements org.apache.hadoop.io.Writable
    Small statistics utility to describe data based on its min/max/mean/median/deviation.
    Author:
    thomas.jungblut
    • Constructor Detail

      • Statistics

        public Statistics()
    • Method Detail

      • add

        public void add​(double item)
        Adds a new data item into the current statistics object.
        Parameters:
        item - a normal double value.
      • finalizeComputation

        public void finalizeComputation()
        Finalize the computation to calculate the mean/median and deviation.
      • write

        public void write​(java.io.DataOutput out)
                   throws java.io.IOException
        Specified by:
        write in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • readFields

        public void readFields​(java.io.DataInput in)
                        throws java.io.IOException
        Specified by:
        readFields in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • getMin

        public double getMin()
      • getMax

        public double getMax()
      • getMedian

        public double getMedian()
      • getMean

        public double getMean()
      • getStandardDeviation

        public double getStandardDeviation()
      • getVariance

        public double getVariance()
      • getSignalToNoise

        public double getSignalToNoise()
      • getDispersionIndex

        public double getDispersionIndex()
      • getCoefficientOfVariation

        public double getCoefficientOfVariation()
      • getSum

        public double getSum()
      • getCount

        public int getCount()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object