Skip navigation links
weka.experiment

Class Stats

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      double count
      The number of values seen
      double max
      The maximum value seen, or Double.NaN if no values seen
      double mean
      The mean of values, or Double.NaN if no values seen
      double min
      The minimum value seen, or Double.NaN if no values seen
      double stdDev
      The std deviation of values at the last calculateDerived() call
      double sum
      The sum of values seen
      double sumSq
      The sum of values squared seen
    • Constructor Summary

      Constructors 
      Constructor and Description
      Stats() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(double value)
      Adds a value to the observed values
      void add(double value, double weight)
      Adds a weighted value to the observed values
      void calculateDerived()
      Tells the object to calculate any statistics that don't have their values automatically updated during add.
      java.lang.String getRevision()
      Returns the revision string.
      static void main(java.lang.String[] args)
      Tests the paired stats object from the command line.
      void subtract(double value)
      Removes a value to the observed values (no checking is done that the value being removed was actually added).
      void subtract(double value, double weight)
      Subtracts a weighted value from the observed values
      java.lang.String toString()
      Returns a string summarising the stats so far.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • count

        public double count
        The number of values seen
      • sum

        public double sum
        The sum of values seen
      • sumSq

        public double sumSq
        The sum of values squared seen
      • stdDev

        public double stdDev
        The std deviation of values at the last calculateDerived() call
      • mean

        public double mean
        The mean of values, or Double.NaN if no values seen
      • min

        public double min
        The minimum value seen, or Double.NaN if no values seen
      • max

        public double max
        The maximum value seen, or Double.NaN if no values seen
    • Constructor Detail

      • Stats

        public Stats()
    • Method Detail

      • add

        public void add(double value)
        Adds a value to the observed values

        It's equivalent to add(value, 1)

        Parameters:
        value - the observed value
      • add

        public void add(double value,
                        double weight)
        Adds a weighted value to the observed values
        Parameters:
        value - the observed value
        weight - the weight of the observed value
      • subtract

        public void subtract(double value)
        Removes a value to the observed values (no checking is done that the value being removed was actually added).

        It's equivalent to subtract(value, 1)

        Parameters:
        value - the observed value
      • subtract

        public void subtract(double value,
                             double weight)
        Subtracts a weighted value from the observed values
        Parameters:
        value - the observed value
        weight - the weight of the observed value
      • calculateDerived

        public void calculateDerived()
        Tells the object to calculate any statistics that don't have their values automatically updated during add. Currently updates the standard deviation.
      • toString

        public java.lang.String toString()
        Returns a string summarising the stats so far.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the summary string
      • getRevision

        public java.lang.String getRevision()
        Returns the revision string.
        Specified by:
        getRevision in interface RevisionHandler
        Returns:
        the revision
      • main

        public static void main(java.lang.String[] args)
        Tests the paired stats object from the command line. reads line from stdin, expecting two values per line.
        Parameters:
        args - ignored.