![]() |
aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
|
<agrum/base/multidim/core/testPolicy/leastSquareTestPolicy.h> More...
#include <leastSquareTestPolicy.h>
Public Member Functions | |
Constructor/Destrcutor | |
| LeastSquareTestPolicy () | |
| Constructor. | |
| void * | operator new (size_t s) |
| Allocators and Deallocators redefinition. | |
| void | operator delete (void *p) |
| Constructor. | |
| virtual | ~LeastSquareTestPolicy () |
| Destructor. | |
Observation insertion | |
| void | addObservation (Idx attr, GUM_ELEMENT value) |
| Comptabilizes the new observation. | |
Test relevance | |
| bool | isTestRelevant () const |
| Returns true if enough observation were made so that the test can be relevant. | |
Test result | |
| void | computeScore () |
| Returns the performance of current variable according to the test. | |
| double | score () |
| Returns the performance of current variable according to the test. | |
| double | secondaryscore () const |
| Returns a second criterion to severe ties. | |
Observation methods | |
| Idx | nbObservation () const |
| Comptabilizes the new observation. | |
Test methods | |
| virtual void | computeScore () const |
| Recomputes the statistic from the beginning. | |
| virtual double | score () const =0 |
| Returns the performance of current variable according to the test. | |
Fusion Methods | |
| void | add (const ITestPolicy< GUM_ELEMENT > &src) |
Miscelleanous Methods | |
| std::string | toString () const |
Protected Member Functions | |
| bool | isModified_ () const |
Private Attributes | |
| bool | _isModified_ |
| Booleans indicating if we have to re eval test. | |
| Idx | _nbObs_ |
Fusion Methods | |
| double | _sumO_ |
| Global sum. | |
| HashTable< Idx, Idx > | _nbObsTable_ |
| Nb Observation for each modality assumed by variable. | |
| HashTable< Idx, double > | _sumAttrTable_ |
| Sum for each modality assumed by variable. | |
| HashTable< Idx, LinkedList< double > * > | _obsTable_ |
| Not sure if needed. | |
| double | _score_ |
| Keeping computed score. | |
| void | add (const LeastSquareTestPolicy< GUM_ELEMENT > &src) |
| Performs the merging of current LeastSquareTestPolicy instance with given instance. | |
| double | sumValue () const |
| Returns global sum (needed for the merging). | |
| const HashTable< Idx, Idx > & | nbObsTable () const |
| Returns nbobs per modality table (needed for the merging). | |
| const HashTable< Idx, double > & | sumAttrTable () const |
| Returns sum per modality table (needed for the merging). | |
| const HashTable< Idx, LinkedList< double > * > & | obsTable () const |
| Returns global sum (needed for the merging). | |
<agrum/base/multidim/core/testPolicy/leastSquareTestPolicy.h>
LeastSquareTestPolicy implements a test policy that follows the Least Square statistic
Definition at line 73 of file leastSquareTestPolicy.h.
| gum::LeastSquareTestPolicy< GUM_ELEMENT >::LeastSquareTestPolicy | ( | ) |
Constructor.
Definition at line 164 of file leastSquareTestPolicy_tpl.h.
References gum::ITestPolicy< GUM_ELEMENT >::ITestPolicy(), LeastSquareTestPolicy(), _score_, and _sumO_.
Referenced by LeastSquareTestPolicy(), ~LeastSquareTestPolicy(), add(), operator delete(), and operator new().
|
virtual |
Destructor.
Definition at line 59 of file leastSquareTestPolicy_tpl.h.
References LeastSquareTestPolicy(), and _obsTable_.
|
inherited |
Definition at line 86 of file ITestPolicy_tpl.h.
References ITestPolicy(), _isModified_, _nbObs_, and nbObservation().
Referenced by gum::Chi2TestPolicy< GUM_ELEMENT >::add(), gum::GTestPolicy< GUM_ELEMENT >::add(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::add().
| void gum::LeastSquareTestPolicy< GUM_ELEMENT >::add | ( | const LeastSquareTestPolicy< GUM_ELEMENT > & | src | ) |
Performs the merging of current LeastSquareTestPolicy instance with given instance.
Definition at line 138 of file leastSquareTestPolicy_tpl.h.
References LeastSquareTestPolicy(), _nbObsTable_, _obsTable_, _sumAttrTable_, gum::ITestPolicy< GUM_ELEMENT >::add(), gum::HashTable< Key, Val >::cbeginSafe(), gum::HashTable< Key, Val >::cendSafe(), gum::Link< T >::element(), nbObsTable(), gum::Link< T >::nextLink(), obsTable(), and sumAttrTable().
|
virtual |
Comptabilizes the new observation.
Reimplemented from gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 74 of file leastSquareTestPolicy_tpl.h.
References _nbObsTable_, _obsTable_, _sumAttrTable_, _sumO_, and gum::ITestPolicy< GUM_ELEMENT >::addObservation().
|
virtualinherited |
Recomputes the statistic from the beginning.
Reimplemented in gum::Chi2TestPolicy< GUM_ELEMENT >, and gum::GTestPolicy< GUM_ELEMENT >.
Definition at line 81 of file ITestPolicy_tpl.h.
References _isModified_.
Referenced by gum::Chi2TestPolicy< GUM_ELEMENT >::computeScore(), gum::GTestPolicy< GUM_ELEMENT >::computeScore(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::computeScore().
| void gum::LeastSquareTestPolicy< GUM_ELEMENT >::computeScore | ( | ) |
Returns the performance of current variable according to the test.
Definition at line 96 of file leastSquareTestPolicy_tpl.h.
References _nbObsTable_, _obsTable_, _score_, _sumAttrTable_, _sumO_, gum::ITestPolicy< GUM_ELEMENT >::computeScore(), gum::Link< T >::element(), gum::ITestPolicy< GUM_ELEMENT >::nbObservation(), and gum::Link< T >::nextLink().
Referenced by score(), and secondaryscore().
|
protectedinherited |
Definition at line 97 of file ITestPolicy_tpl.h.
References _isModified_.
Referenced by gum::Chi2TestPolicy< GUM_ELEMENT >::score(), gum::GTestPolicy< GUM_ELEMENT >::score(), gum::LeastSquareTestPolicy< GUM_ELEMENT >::score(), gum::Chi2TestPolicy< GUM_ELEMENT >::secondaryscore(), gum::GTestPolicy< GUM_ELEMENT >::secondaryscore(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::secondaryscore().
|
virtual |
Returns true if enough observation were made so that the test can be relevant.
Implements gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 180 of file leastSquareTestPolicy_tpl.h.
References gum::ITestPolicy< GUM_ELEMENT >::nbObservation().
|
inherited |
Comptabilizes the new observation.
Definition at line 76 of file ITestPolicy_tpl.h.
References _nbObs_.
Referenced by add(), gum::Chi2TestPolicy< GUM_ELEMENT >::computeScore(), gum::GTestPolicy< GUM_ELEMENT >::computeScore(), gum::LeastSquareTestPolicy< GUM_ELEMENT >::computeScore(), gum::Chi2TestPolicy< GUM_ELEMENT >::isTestRelevant(), gum::GTestPolicy< GUM_ELEMENT >::isTestRelevant(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::isTestRelevant().
| const HashTable< Idx, Idx > & gum::LeastSquareTestPolicy< GUM_ELEMENT >::nbObsTable | ( | ) | const |
Returns nbobs per modality table (needed for the merging).
Definition at line 190 of file leastSquareTestPolicy_tpl.h.
References _nbObsTable_.
Referenced by add().
| const HashTable< Idx, LinkedList< double > * > & gum::LeastSquareTestPolicy< GUM_ELEMENT >::obsTable | ( | ) | const |
Returns global sum (needed for the merging).
Definition at line 201 of file leastSquareTestPolicy_tpl.h.
References _obsTable_.
Referenced by add().
| void gum::LeastSquareTestPolicy< GUM_ELEMENT >::operator delete | ( | void * | p | ) |
Constructor.
Definition at line 175 of file leastSquareTestPolicy_tpl.h.
References LeastSquareTestPolicy(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
| void * gum::LeastSquareTestPolicy< GUM_ELEMENT >::operator new | ( | size_t | s | ) |
Allocators and Deallocators redefinition.
Definition at line 170 of file leastSquareTestPolicy_tpl.h.
References LeastSquareTestPolicy(), gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
|
pure virtualinherited |
Returns the performance of current variable according to the test.
Implemented in gum::Chi2TestPolicy< GUM_ELEMENT >, and gum::GTestPolicy< GUM_ELEMENT >.
| double gum::LeastSquareTestPolicy< GUM_ELEMENT >::score | ( | ) |
Returns the performance of current variable according to the test.
Definition at line 123 of file leastSquareTestPolicy_tpl.h.
References _score_, computeScore(), and gum::ITestPolicy< GUM_ELEMENT >::isModified_().
|
virtual |
Returns a second criterion to severe ties.
Implements gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 132 of file leastSquareTestPolicy_tpl.h.
References _score_, computeScore(), and gum::ITestPolicy< GUM_ELEMENT >::isModified_().
| const HashTable< Idx, double > & gum::LeastSquareTestPolicy< GUM_ELEMENT >::sumAttrTable | ( | ) | const |
Returns sum per modality table (needed for the merging).
Definition at line 195 of file leastSquareTestPolicy_tpl.h.
References _sumAttrTable_.
Referenced by add().
| double gum::LeastSquareTestPolicy< GUM_ELEMENT >::sumValue | ( | ) | const |
Returns global sum (needed for the merging).
Definition at line 185 of file leastSquareTestPolicy_tpl.h.
References _sumO_.
|
inherited |
Definition at line 92 of file ITestPolicy_tpl.h.
References _nbObs_.
Referenced by gum::Chi2TestPolicy< GUM_ELEMENT >::toString(), and gum::GTestPolicy< GUM_ELEMENT >::toString().
|
mutableprivateinherited |
Booleans indicating if we have to re eval test.
Definition at line 175 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), computeScore(), and isModified_().
|
privateinherited |
Definition at line 178 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), nbObservation(), and toString().
|
private |
Nb Observation for each modality assumed by variable.
Definition at line 183 of file leastSquareTestPolicy.h.
Referenced by add(), addObservation(), computeScore(), and nbObsTable().
|
private |
Not sure if needed.
Definition at line 189 of file leastSquareTestPolicy.h.
Referenced by ~LeastSquareTestPolicy(), add(), addObservation(), computeScore(), and obsTable().
|
private |
Keeping computed score.
Definition at line 192 of file leastSquareTestPolicy.h.
Referenced by LeastSquareTestPolicy(), computeScore(), score(), and secondaryscore().
|
private |
Sum for each modality assumed by variable.
Definition at line 186 of file leastSquareTestPolicy.h.
Referenced by add(), addObservation(), computeScore(), and sumAttrTable().
|
private |
Global sum.
Definition at line 180 of file leastSquareTestPolicy.h.
Referenced by LeastSquareTestPolicy(), addObservation(), computeScore(), and sumValue().