58 template <
typename GUM_ELEMENT >
73 template <
typename GUM_ELEMENT >
95 template <
typename GUM_ELEMENT >
100 double sumErrorAttr = 0.0;
103 Idx key = attrIter.key();
105 double errorAttr = 0.0;
109 errorAttr += std::pow(linky->
element() - meanAttr, 2);
110 errorO += std::pow(linky->
element() - mean, 2);
116 _score_ = errorO - sumErrorAttr;
122 template <
typename GUM_ELEMENT >
131 template <
typename GUM_ELEMENT >
137 template <
typename GUM_ELEMENT >
151 for (
auto obsIter = src.
obsTable().cbeginSafe(); obsIter != src.
obsTable().cendSafe();
163 template <
typename GUM_ELEMENT >
169 template <
typename GUM_ELEMENT >
174 template <
typename GUM_ELEMENT >
179 template <
typename GUM_ELEMENT >
184 template <
typename GUM_ELEMENT >
189 template <
typename GUM_ELEMENT >
194 template <
typename GUM_ELEMENT >
199 template <
typename GUM_ELEMENT >
const_iterator_safe cbeginSafe() const
Returns the safe const_iterator pointing to the beginning of the hashtable.
const const_iterator_safe & cendSafe() const noexcept
Returns the safe const_iterator pointing to the end of the hashtable.
ITestPolicy()
Allocators and Deallocators redefinition.
virtual void addObservation(Idx attr, GUM_ELEMENT value)
Comptabilizes the new observation.
virtual void computeScore() const
Recomputes the statistic from the beginning.
void add(const ITestPolicy< GUM_ELEMENT > &src)
Idx nbObservation() const
Comptabilizes the new observation.
void addObservation(Idx attr, GUM_ELEMENT value)
Comptabilizes the new observation.
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).
virtual ~LeastSquareTestPolicy()
Destructor.
double secondaryscore() const
Returns a second criterion to severe ties.
HashTable< Idx, Idx > _nbObsTable_
Nb Observation for each modality assumed by variable.
LeastSquareTestPolicy()
Constructor.
void computeScore()
Returns the performance of current variable according to the test.
const HashTable< Idx, LinkedList< double > * > & obsTable() const
Returns global sum (needed for the merging).
const HashTable< Idx, double > & sumAttrTable() const
Returns sum per modality table (needed for the merging).
HashTable< Idx, double > _sumAttrTable_
Sum for each modality assumed by variable.
bool isTestRelevant() const
Returns true if enough observation were made so that the test can be relevant.
double score()
Returns the performance of current variable according to the test.
const HashTable< Idx, Idx > & nbObsTable() const
Returns nbobs per modality table (needed for the merging).
HashTable< Idx, LinkedList< double > * > _obsTable_
Not sure if needed.
const T & element() const
Returns the element stored in this link.
const Link< T > * nextLink() const
Returns next link.
static SmallObjectAllocator & instance()
void * allocate(const size_t &objectSize)
Allocates a block.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
Size Idx
Type for indexes.
Headers of the LeastSquareTestPolicy.
gum is the global namespace for all aGrUM entities