30 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_LEAST_SQUARE_TEST_POLICY_H 31 #define GUM_MULTI_DIM_FUNCTION_GRAPH_LEAST_SQUARE_TEST_POLICY_H 34 #include <agrum/FMDP/learning/core/contingencyTable.h> 35 #include <agrum/FMDP/learning/core/testPolicy/ITestPolicy.h> 37 #include <agrum/tools/multidim/utils/FunctionGraphUtilities/link.h> 51 template <
typename GUM_SCALAR >
63 GUM_CONSTRUCTOR(LeastSquareTestPolicy);
69 void*
operator new(size_t s) {
return SmallObjectAllocator::instance().allocate(s); }
71 SmallObjectAllocator::instance().deallocate(p,
sizeof(LeastSquareTestPolicy));
180 #include <agrum/FMDP/learning/core/testPolicy/leastSquareTestPolicy_tpl.h> const HashTable< Idx, LinkedList< double > *> & obsTable() const
Returns global sum (needed for the merging)
double score()
Returns the performance of current variable according to the test.
void operator delete(void *p)
Constructor.
const HashTable< Idx, Idx > & nbObsTable() const
Returns nbobs per modality table (needed for the merging)
virtual ~LeastSquareTestPolicy()
Destructor.
double secondaryscore() const
Returns a second criterion to severe ties.
const HashTable< Idx, double > & sumAttrTable() const
Returns sum per modality table (needed for the merging)
INLINE void emplace(Args &&... args)
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)
bool isTestRelevant() const
Returns true if enough observation were made so that the test can be relevant.
void addObservation(Idx attr, GUM_SCALAR value)
Comptabilizes the new observation.
LeastSquareTestPolicy()
Constructor.
HashTable< Idx, Idx > _nbObsTable_
Nb Observation for each modality assumed by variable.
void computeScore()
Returns the performance of current variable according to the test.
void * operator new(size_t s)
Allocators and Deallocators redefinition.
HashTable< Idx, double > _sumAttrTable_
Sum for each modality assumed by variable.