All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.experiment.Stats

java.lang.Object
    |
    +----weka.experiment.Stats

public class Stats
extends java.lang.Object
A class to store simple statistics

Version:
$Revision: 1.7.2.1 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Variable Index

 o count
The number of values seen
 o max
The maximum value seen, or Double.NaN if no values seen
 o mean
The mean of values at the last calculateDerived() call
 o min
The minimum value seen, or Double.NaN if no values seen
 o stdDev
The std deviation of values at the last calculateDerived() call
 o sum
The sum of values seen
 o sumSq
The sum of values squared seen

Constructor Index

 o Stats()
 

Method Index

 o add(double)
Adds a value to the observed values
 o add(double, double)
Adds a value that has been seen n times to the observed values
 o calculateDerived()
Tells the object to calculate any statistics that don't have their values automatically updated during add.
 o main(String[])
Tests the paired stats object from the command line.
 o subtract(double)
Removes a value to the observed values (no checking is done that the value being removed was actually added).
 o subtract(double, double)
Subtracts a value that has been seen n times from the observed values
 o toString()
Returns a string summarising the stats so far.

Field Detail

 o count
public double count
          The number of values seen
 o sum
public double sum
          The sum of values seen
 o sumSq
public double sumSq
          The sum of values squared seen
 o stdDev
public double stdDev
          The std deviation of values at the last calculateDerived() call
 o mean
public double mean
          The mean of values at the last calculateDerived() call
 o min
public double min
          The minimum value seen, or Double.NaN if no values seen
 o max
public double max
          The maximum value seen, or Double.NaN if no values seen

Constructor Detail

 o Stats
public Stats()

Method Detail

 o add
public void add(double value)
          Adds a value to the observed values
Parameters:
value - the observed value
 o add
public void add(double value,
                double n)
          Adds a value that has been seen n times to the observed values
Parameters:
value - the observed value
n - the number of times to add value
 o 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).
Parameters:
value - the observed value
 o subtract
public void subtract(double value,
                     double n)
          Subtracts a value that has been seen n times from the observed values
Parameters:
value - the observed value
n - the number of times to subtract value
 o calculateDerived
public void calculateDerived()
          Tells the object to calculate any statistics that don't have their values automatically updated during add. Currently updates the mean and standard deviation.
 o toString
public java.lang.String toString()
          Returns a string summarising the stats so far.
Returns:
the summary string
Overrides:
toString in class java.lang.Object
 o 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home