PLearn 0.1
|
#include <StatsIterator.h>
Public Member Functions | |
StatsItArray () | |
StatsItArray (const StatsIt &statsit) | |
StatsItArray (const StatsIt &statsit1, const StatsIt &statsit2) | |
StatsItArray (const Array< StatsIt > &va) | |
StatsItArray (Array< StatsIt > &va) | |
StatsItArray (const StatsItArray &va) | |
StatsItArray & | operator&= (const StatsIt &v) |
StatsItArray & | operator&= (const StatsItArray &va) |
StatsItArray | operator& (const StatsIt &v) const |
StatsItArray | operator& (const StatsItArray &va) const |
void | init (int inputsize) |
void | update (const Vec &input) |
void | update (const Mat &inputs) |
bool | requiresMultiplePasses () |
returns true if any of the StatsIterator in the array requires more than one pass through the data | |
StatsItArray | finish () |
returns an array of those that are not yet finished | |
Array< Vec > | getResults () |
Array< Vec > | computeStats (VMat data) |
Definition at line 378 of file StatsIterator.h.
PLearn::StatsItArray::StatsItArray | ( | ) |
Definition at line 746 of file StatsIterator.cc.
: Array<StatsIt>(0,5) {}
PLearn::StatsItArray::StatsItArray | ( | const StatsIt & | statsit | ) |
Definition at line 750 of file StatsIterator.cc.
: Array<StatsIt>(1,5) { (*this)[0] = statsit; }
Definition at line 754 of file StatsIterator.cc.
: Array<StatsIt>(2,5) { (*this)[0] = statsit1; (*this)[1] = statsit2; }
Definition at line 385 of file StatsIterator.h.
: Array<StatsIt>(va) {}
Definition at line 386 of file StatsIterator.h.
: Array<StatsIt>(va) {}
PLearn::StatsItArray::StatsItArray | ( | const StatsItArray & | va | ) | [inline] |
Definition at line 387 of file StatsIterator.h.
: Array<StatsIt>(va) {}
Definition at line 807 of file StatsIterator.cc.
References finish(), getResults(), i, init(), PLearn::TVec< StatsIt >::input(), PLearn::VMat::length(), PLearn::TVec< T >::size(), update(), and PLearn::VMat::width().
Referenced by PLearn::Learner::computeTestStatistics(), and PLearn::Learner::test().
{ int inputsize = data.width(); init(inputsize); Vec input(inputsize); StatsItArray unfinished = *this; while(unfinished.size()>0) { for(int i=0; i<data.length(); i++) { data->getRow(i,input); unfinished.update(input); } unfinished = finish(); } return getResults(); }
StatsItArray PLearn::StatsItArray::finish | ( | ) |
returns an array of those that are not yet finished
Definition at line 790 of file StatsIterator.cc.
References PLearn::TVec< T >::append(), and PLearn::TVec< StatsIt >::size().
Referenced by computeStats(), and PLearn::Learner::test().
{ StatsItArray unfinished; for(int k=0; k<size(); k++) if ( ! (*this)[k]->finish() ) unfinished.append((*this)[k]); return unfinished; }
Definition at line 799 of file StatsIterator.cc.
References PLearn::TVec< StatsIt >::size().
Referenced by computeStats(), and PLearn::Learner::test().
{ Array<Vec> results(size()); for(int k=0; k<size(); k++) results[k] = (*this)[k]->getResult(); return results; }
void PLearn::StatsItArray::init | ( | int | inputsize | ) |
Definition at line 761 of file StatsIterator.cc.
References PLearn::TVec< StatsIt >::size().
Referenced by computeStats(), and PLearn::Learner::test().
{ for(int k=0; k<size(); k++) (*this)[k]->init(inputsize); }
StatsItArray PLearn::StatsItArray::operator& | ( | const StatsIt & | v | ) | const [inline] |
Definition at line 392 of file StatsIterator.h.
References PLearn::operator&().
{ return PLearn::operator&(*this,v); }
StatsItArray PLearn::StatsItArray::operator& | ( | const StatsItArray & | va | ) | const [inline] |
Definition at line 394 of file StatsIterator.h.
References PLearn::operator&().
{ return PLearn::operator&(*this,va); }
StatsItArray& PLearn::StatsItArray::operator&= | ( | const StatsItArray & | va | ) | [inline] |
Definition at line 390 of file StatsIterator.h.
References PLearn::operator&=().
{ PLearn::operator&=(*this,va); return *this; }
StatsItArray& PLearn::StatsItArray::operator&= | ( | const StatsIt & | v | ) | [inline] |
Definition at line 388 of file StatsIterator.h.
References PLearn::operator&=().
{ PLearn::operator&=(*this,v); return *this;}
bool PLearn::StatsItArray::requiresMultiplePasses | ( | ) |
returns true if any of the StatsIterator in the array requires more than one pass through the data
Definition at line 781 of file StatsIterator.cc.
References PLearn::TVec< StatsIt >::size().
Referenced by PLearn::Learner::test().
{ for(int k=0; k<size(); k++) if ( (*this)[k]->requiresMultiplePasses() ) return true; return false; }
void PLearn::StatsItArray::update | ( | const Vec & | input | ) |
Definition at line 767 of file StatsIterator.cc.
References PLearn::TVec< StatsIt >::size().
Referenced by computeStats(), PLearn::Learner::test(), and update().
void PLearn::StatsItArray::update | ( | const Mat & | inputs | ) |
Definition at line 772 of file StatsIterator.cc.
References i, PLearn::TVec< StatsIt >::input(), PLearn::TMat< T >::length(), and update().