Class RunningStats

  • All Implemented Interfaces:
    java.lang.Cloneable, Writeable

    public class RunningStats
    extends java.lang.Object
    implements Writeable, java.lang.Cloneable
    Descriptive stats gathered per shard. Coordinating node computes final correlation and covariance stats based on these descriptive stats. This single pass, parallel approach is based on: http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.HashMap<java.lang.String,​java.lang.Long> counts
      counts
      protected java.util.HashMap<java.lang.String,​java.util.HashMap<java.lang.String,​java.lang.Double>> covariances
      covariance values
      protected long docCount
      count of observations (same number of observations per field)
      protected java.util.HashMap<java.lang.String,​java.lang.Double> fieldSum
      per field sum of observations
      protected java.util.HashMap<java.lang.String,​java.lang.Double> kurtosis
      kurtosis values (fourth moment)
      protected java.util.HashMap<java.lang.String,​java.lang.Double> means
      mean values (first moment)
      protected java.util.HashMap<java.lang.String,​java.lang.Double> skewness
      skewness values (third moment)
      protected java.util.HashMap<java.lang.String,​java.lang.Double> variances
      variance values (second moment)
    • Constructor Summary

      Constructors 
      Constructor Description
      RunningStats​(StreamInput in)
      Ctor to create an instance of running statistics
    • Method Summary

      Modifier and Type Method Description
      void add​(java.lang.String[] fieldNames, double[] fieldVals)
      updates running statistics with a documents field values
      RunningStats clone()  
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      void merge​(RunningStats other)
      Merges the descriptive statistics of a second data set (e.g., per shard) running computations taken from: http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf
      void writeTo​(StreamOutput out)  
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • docCount

        protected long docCount
        count of observations (same number of observations per field)
      • fieldSum

        protected java.util.HashMap<java.lang.String,​java.lang.Double> fieldSum
        per field sum of observations
      • counts

        protected java.util.HashMap<java.lang.String,​java.lang.Long> counts
        counts
      • means

        protected java.util.HashMap<java.lang.String,​java.lang.Double> means
        mean values (first moment)
      • variances

        protected java.util.HashMap<java.lang.String,​java.lang.Double> variances
        variance values (second moment)
      • skewness

        protected java.util.HashMap<java.lang.String,​java.lang.Double> skewness
        skewness values (third moment)
      • kurtosis

        protected java.util.HashMap<java.lang.String,​java.lang.Double> kurtosis
        kurtosis values (fourth moment)
      • covariances

        protected java.util.HashMap<java.lang.String,​java.util.HashMap<java.lang.String,​java.lang.Double>> covariances
        covariance values
    • Constructor Detail

      • RunningStats

        public RunningStats​(StreamInput in)
                     throws java.io.IOException
        Ctor to create an instance of running statistics
        Throws:
        java.io.IOException
    • Method Detail

      • writeTo

        public void writeTo​(StreamOutput out)
                     throws java.io.IOException
        Specified by:
        writeTo in interface Writeable
        Throws:
        java.io.IOException
      • add

        public void add​(java.lang.String[] fieldNames,
                        double[] fieldVals)
        updates running statistics with a documents field values
      • merge

        public void merge​(RunningStats other)
        Merges the descriptive statistics of a second data set (e.g., per shard) running computations taken from: http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf
      • clone

        public RunningStats clone()
        Overrides:
        clone in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object