![]() |
aGrUM 2.3.2
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_SCALAR 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_SCALAR > &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_SCALAR > &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.
|
inline |
Constructor.
Definition at line 83 of file leastSquareTestPolicy.h.
References gum::ITestPolicy< GUM_SCALAR >::ITestPolicy(), LeastSquareTestPolicy(), _score_, and _sumO_.
Referenced by LeastSquareTestPolicy(), ~LeastSquareTestPolicy(), add(), and operator delete().
|
virtual |
Destructor.
Definition at line 58 of file leastSquareTestPolicy_tpl.h.
References LeastSquareTestPolicy(), and _obsTable_.
|
inlineinherited |
Definition at line 161 of file ITestPolicy.h.
References ITestPolicy(), _isModified_, _nbObs_, and nbObservation().
Referenced by gum::Chi2TestPolicy< GUM_SCALAR >::add(), gum::GTestPolicy< GUM_SCALAR >::add(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::add().
| void gum::LeastSquareTestPolicy< GUM_SCALAR >::add | ( | const LeastSquareTestPolicy< GUM_SCALAR > & | src | ) |
Performs the merging of current LeastSquareTestPolicy instance with given instance.
Definition at line 137 of file leastSquareTestPolicy_tpl.h.
References LeastSquareTestPolicy(), _nbObsTable_, _obsTable_, _sumAttrTable_, gum::ITestPolicy< GUM_SCALAR >::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_SCALAR >.
Definition at line 73 of file leastSquareTestPolicy_tpl.h.
References _nbObsTable_, _obsTable_, _sumAttrTable_, _sumO_, and gum::ITestPolicy< GUM_SCALAR >::addObservation().
|
inlinevirtualinherited |
Recomputes the statistic from the beginning.
Reimplemented in gum::Chi2TestPolicy< GUM_SCALAR >, and gum::GTestPolicy< GUM_SCALAR >.
Definition at line 138 of file ITestPolicy.h.
References _isModified_.
Referenced by gum::Chi2TestPolicy< GUM_SCALAR >::computeScore(), gum::GTestPolicy< GUM_SCALAR >::computeScore(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::computeScore().
| void gum::LeastSquareTestPolicy< GUM_SCALAR >::computeScore | ( | ) |
Returns the performance of current variable according to the test.
Definition at line 95 of file leastSquareTestPolicy_tpl.h.
References _nbObsTable_, _obsTable_, _score_, _sumAttrTable_, _sumO_, gum::ITestPolicy< GUM_SCALAR >::computeScore(), gum::Link< T >::element(), gum::ITestPolicy< GUM_SCALAR >::nbObservation(), and gum::Link< T >::nextLink().
Referenced by score(), and secondaryscore().
|
inlineprotectedinherited |
Definition at line 186 of file ITestPolicy.h.
References _isModified_.
Referenced by gum::Chi2TestPolicy< GUM_SCALAR >::score(), gum::GTestPolicy< GUM_SCALAR >::score(), gum::LeastSquareTestPolicy< GUM_SCALAR >::score(), gum::Chi2TestPolicy< GUM_SCALAR >::secondaryscore(), gum::GTestPolicy< GUM_SCALAR >::secondaryscore(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::secondaryscore().
|
inlinevirtual |
Returns true if enough observation were made so that the test can be relevant.
Implements gum::ITestPolicy< GUM_SCALAR >.
Definition at line 123 of file leastSquareTestPolicy.h.
References gum::ITestPolicy< GUM_SCALAR >::nbObservation().
|
inlineinherited |
Comptabilizes the new observation.
Definition at line 119 of file ITestPolicy.h.
References _nbObs_.
Referenced by add(), gum::Chi2TestPolicy< GUM_SCALAR >::computeScore(), gum::GTestPolicy< GUM_SCALAR >::computeScore(), gum::LeastSquareTestPolicy< GUM_SCALAR >::computeScore(), gum::Chi2TestPolicy< GUM_SCALAR >::isTestRelevant(), gum::GTestPolicy< GUM_SCALAR >::isTestRelevant(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::isTestRelevant().
|
inline |
Returns nbobs per modality table (needed for the merging).
Definition at line 170 of file leastSquareTestPolicy.h.
References _nbObsTable_.
Referenced by add().
|
inline |
Returns global sum (needed for the merging).
Definition at line 180 of file leastSquareTestPolicy.h.
References _obsTable_.
Referenced by add().
|
inline |
Constructor.
Definition at line 92 of file leastSquareTestPolicy.h.
References LeastSquareTestPolicy(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
|
inline |
Allocators and Deallocators redefinition.
Definition at line 90 of file leastSquareTestPolicy.h.
References gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
|
pure virtualinherited |
Returns the performance of current variable according to the test.
Implemented in gum::Chi2TestPolicy< GUM_SCALAR >, and gum::GTestPolicy< GUM_SCALAR >.
| double gum::LeastSquareTestPolicy< GUM_SCALAR >::score | ( | ) |
Returns the performance of current variable according to the test.
Definition at line 122 of file leastSquareTestPolicy_tpl.h.
References _score_, computeScore(), and gum::ITestPolicy< GUM_SCALAR >::isModified_().
|
virtual |
Returns a second criterion to severe ties.
Implements gum::ITestPolicy< GUM_SCALAR >.
Definition at line 131 of file leastSquareTestPolicy_tpl.h.
References _score_, computeScore(), and gum::ITestPolicy< GUM_SCALAR >::isModified_().
|
inline |
Returns sum per modality table (needed for the merging).
Definition at line 175 of file leastSquareTestPolicy.h.
References _sumAttrTable_.
Referenced by add().
|
inline |
Returns global sum (needed for the merging).
Definition at line 165 of file leastSquareTestPolicy.h.
References _sumO_.
|
inlineinherited |
|
mutableprivateinherited |
Booleans indicating if we have to re eval test.
Definition at line 190 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), computeScore(), and isModified_().
|
privateinherited |
Definition at line 193 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), nbObservation(), and toString().
|
private |
Nb Observation for each modality assumed by variable.
Definition at line 187 of file leastSquareTestPolicy.h.
Referenced by add(), addObservation(), computeScore(), and nbObsTable().
|
private |
Not sure if needed.
Definition at line 193 of file leastSquareTestPolicy.h.
Referenced by ~LeastSquareTestPolicy(), add(), addObservation(), computeScore(), and obsTable().
|
private |
Keeping computed score.
Definition at line 196 of file leastSquareTestPolicy.h.
Referenced by LeastSquareTestPolicy(), computeScore(), score(), and secondaryscore().
|
private |
Sum for each modality assumed by variable.
Definition at line 190 of file leastSquareTestPolicy.h.
Referenced by add(), addObservation(), computeScore(), and sumAttrTable().
|
private |
Global sum.
Definition at line 184 of file leastSquareTestPolicy.h.
Referenced by LeastSquareTestPolicy(), addObservation(), computeScore(), and sumValue().