Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::VMFieldStat Class Reference

this class holds simple statistics about a field More...

#include <VMField.h>

Collaboration diagram for PLearn::VMFieldStat:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VMFieldStat (int the_maxndiscrete=255)
 VMFieldStat *.

int count () const
 should be equal to length of VMField

int nmissing () const
int nnonmissing () const
int npositive () const
int nnegative () const
int nzero () const
real sum () const
real sumsquare () const
real min () const
real max () const
real mean () const
real variance () const
real stddev () const
real prob (real value)
void update (real val)
void write (ostream &out) const
void read (istream &in)

Public Attributes

map< real, intcounts
 counts of discrete values.


Protected Attributes

int nmissing_
 number of missing values

int nnonmissing_
 number of non-missing values

int npositive_
 number of values >0

int nnegative_
 number of values <0

double sum_
 sum of all non missing values

double sumsquare_
 sum of square of all non missing values

real min_
 minimum value

real max_
 maximum value

int maxndiscrete
 maximum number of different discrete values to keep track of


Detailed Description

this class holds simple statistics about a field

Definition at line 93 of file VMField.h.


Constructor & Destructor Documentation

PLearn::VMFieldStat::VMFieldStat int  the_maxndiscrete = 255  ) 
 

VMFieldStat *.

Definition at line 101 of file VMField.cc.


Member Function Documentation

int PLearn::VMFieldStat::count  )  const [inline]
 

should be equal to length of VMField

Definition at line 116 of file VMField.h.

References nmissing_, and nnonmissing_.

Referenced by read().

real PLearn::VMFieldStat::max  )  const [inline]
 

Definition at line 125 of file VMField.h.

References max_.

Referenced by PLearn::CompactVMatrix::CompactVMatrix().

real PLearn::VMFieldStat::mean  )  const [inline]
 

Definition at line 126 of file VMField.h.

References nnonmissing_, and sum_.

real PLearn::VMFieldStat::min  )  const [inline]
 

Definition at line 124 of file VMField.h.

References min_.

Referenced by PLearn::CompactVMatrix::CompactVMatrix().

int PLearn::VMFieldStat::nmissing  )  const [inline]
 

Definition at line 117 of file VMField.h.

References nmissing_.

Referenced by PLearn::SparseVMatrix::SparseVMatrix().

int PLearn::VMFieldStat::nnegative  )  const [inline]
 

Definition at line 120 of file VMField.h.

References nnegative_.

Referenced by PLearn::SparseVMatrix::SparseVMatrix().

int PLearn::VMFieldStat::nnonmissing  )  const [inline]
 

Definition at line 118 of file VMField.h.

References nnonmissing_.

Referenced by prob().

int PLearn::VMFieldStat::npositive  )  const [inline]
 

Definition at line 119 of file VMField.h.

References npositive_.

Referenced by PLearn::SparseVMatrix::SparseVMatrix().

int PLearn::VMFieldStat::nzero  )  const [inline]
 

Definition at line 121 of file VMField.h.

References nnegative_, nnonmissing_, and npositive_.

real PLearn::VMFieldStat::prob real  value  )  [inline]
 

Definition at line 130 of file VMField.h.

References counts, nnonmissing(), and prob().

Referenced by PLearn::CompactVMatrix::perturb(), and prob().

void PLearn::VMFieldStat::read istream &  in  ) 
 

Definition at line 158 of file VMField.cc.

References count, count(), counts, k, max_, min_, nmissing_, nnegative_, nnonmissing_, npositive_, sum_, and sumsquare_.

real PLearn::VMFieldStat::stddev  )  const [inline]
 

Definition at line 128 of file VMField.h.

References PLearn::sqrt(), and variance().

real PLearn::VMFieldStat::sum  )  const [inline]
 

Definition at line 122 of file VMField.h.

References sum_.

real PLearn::VMFieldStat::sumsquare  )  const [inline]
 

Definition at line 123 of file VMField.h.

References sumsquare_.

void PLearn::VMFieldStat::update real  val  ) 
 

Definition at line 106 of file VMField.cc.

References counts, PLearn::is_missing(), max_, maxndiscrete, min_, nmissing_, nnegative_, nnonmissing_, npositive_, sum_, sumsquare_, and val.

real PLearn::VMFieldStat::variance  )  const [inline]
 

Definition at line 127 of file VMField.h.

References nnonmissing_, PLearn::square(), sum_, and sumsquare_.

Referenced by stddev().

void PLearn::VMFieldStat::write ostream &  out  )  const
 

Definition at line 136 of file VMField.cc.

References counts, max_, min_, nmissing_, nnegative_, nnonmissing_, npositive_, sum_, and sumsquare_.


Member Data Documentation

map<real,int> PLearn::VMFieldStat::counts
 

counts of discrete values.

If the size of counts exceeds maxndiscrete maxndiscrete is set to -1, counts is erased, and we stop counting!

Definition at line 112 of file VMField.h.

Referenced by PLearn::CompactVMatrix::CompactVMatrix(), prob(), read(), update(), and write().

real PLearn::VMFieldStat::max_ [protected]
 

maximum value

Definition at line 103 of file VMField.h.

Referenced by max(), read(), update(), and write().

int PLearn::VMFieldStat::maxndiscrete [protected]
 

maximum number of different discrete values to keep track of

Definition at line 106 of file VMField.h.

Referenced by update().

real PLearn::VMFieldStat::min_ [protected]
 

minimum value

Definition at line 102 of file VMField.h.

Referenced by min(), read(), update(), and write().

int PLearn::VMFieldStat::nmissing_ [protected]
 

number of missing values

Definition at line 96 of file VMField.h.

Referenced by count(), nmissing(), read(), update(), and write().

int PLearn::VMFieldStat::nnegative_ [protected]
 

number of values <0

Definition at line 99 of file VMField.h.

Referenced by nnegative(), nzero(), read(), update(), and write().

int PLearn::VMFieldStat::nnonmissing_ [protected]
 

number of non-missing values

Definition at line 97 of file VMField.h.

Referenced by count(), mean(), nnonmissing(), nzero(), read(), update(), variance(), and write().

int PLearn::VMFieldStat::npositive_ [protected]
 

number of values >0

Definition at line 98 of file VMField.h.

Referenced by npositive(), nzero(), read(), update(), and write().

double PLearn::VMFieldStat::sum_ [protected]
 

sum of all non missing values

Definition at line 100 of file VMField.h.

Referenced by mean(), read(), sum(), update(), variance(), and write().

double PLearn::VMFieldStat::sumsquare_ [protected]
 

sum of square of all non missing values

Definition at line 101 of file VMField.h.

Referenced by read(), sumsquare(), update(), variance(), and write().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:03 2004 for PLearn by doxygen 1.3.7