57 template <
typename GUM_SCALAR >
72 template <
typename GUM_SCALAR >
94 template <
typename GUM_SCALAR >
99 double sumErrorAttr = 0.0;
102 Idx key = attrIter.key();
104 double errorAttr = 0.0;
108 errorAttr += std::pow(linky->
element() - meanAttr, 2);
109 errorO += std::pow(linky->
element() - mean, 2);
115 _score_ = errorO - sumErrorAttr;
121 template <
typename GUM_SCALAR >
130 template <
typename GUM_SCALAR >
136 template <
typename GUM_SCALAR >
150 for (
auto obsIter = src.
obsTable().cbeginSafe(); obsIter != src.
obsTable().cendSafe();
const const_iterator_safe & cendSafe() const noexcept
Returns the safe const_iterator pointing to the end of the hashtable.
const_iterator_safe cbeginSafe() const
Returns the safe const_iterator pointing to the beginning of the hashtable.
Idx nbObservation() const
Comptabilizes the new observation.
virtual void computeScore() const
Recomputes the statistic from the beginning.
virtual void addObservation(Idx attr, GUM_SCALAR value)
Comptabilizes the new observation.
void add(const ITestPolicy< GUM_SCALAR > &src)
void add(const LeastSquareTestPolicy< GUM_SCALAR > &src)
Performs the merging of current LeastSquareTestPolicy instance with given instance.
virtual ~LeastSquareTestPolicy()
Destructor.
double _score_
Keeping computed score.
HashTable< Idx, Idx > _nbObsTable_
Nb Observation for each modality assumed by variable.
HashTable< Idx, double > _sumAttrTable_
Sum for each modality assumed by variable.
const HashTable< Idx, Idx > & nbObsTable() const
Returns nbobs per modality table (needed for the merging).
HashTable< Idx, LinkedList< double > * > _obsTable_
Not sure if needed.
void addObservation(Idx attr, GUM_SCALAR value)
Comptabilizes the new observation.
const HashTable< Idx, double > & sumAttrTable() const
Returns sum per modality table (needed for the merging).
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).
double secondaryscore() const
Returns a second criterion to severe ties.
LeastSquareTestPolicy()
Constructor.
double score()
Returns the performance of current variable according to the test.
const Link< T > * nextLink() const
Returns next link.
const T & element() const
Returns the element stored in this link.
Size Idx
Type for indexes.
Headers of the LeastSquareTestPolicy.
gum is the global namespace for all aGrUM entities