30 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_G_TEST_POLICY_H 31 #define GUM_MULTI_DIM_FUNCTION_GRAPH_G_TEST_POLICY_H 33 #include <agrum/FMDP/learning/core/chiSquare.h> 34 #include <agrum/FMDP/learning/core/contingencyTable.h> 35 #include <agrum/FMDP/learning/core/testPolicy/ITestPolicy.h> 36 #include <agrum/FMDP/learning/core/tupleHashFunc.h> 52 template <
typename GUM_SCALAR >
64 GUM_CONSTRUCTOR(GTestPolicy);
71 GUM_DESTRUCTOR(GTestPolicy);
78 void*
operator new(size_t s) {
return SmallObjectAllocator::instance().allocate(s); }
81 SmallObjectAllocator::instance().deallocate(p,
sizeof(GTestPolicy));
109 return (
this->nbObservation() > 20 &&
this->nbObservation() > _conTab_.attrASize() * 5);
120 double score()
const;
157 std::stringstream ss;
158 ss << ITestPolicy< GUM_SCALAR >::toString() <<
"\t\t\tContingency Table : " << std::endl
159 << _conTab_.toString() << std::endl
160 <<
"\t\t\tGStat : " << _GStat_ << std::endl
161 <<
"\t\t\tGStat : " <<
this->secondaryscore() << std::endl;
175 #include <agrum/FMDP/learning/core/testPolicy/GTestPolicy_tpl.h> void computeScore() const
Computes the GStat of current variable according to the test.
virtual ~GTestPolicy()
Destructor.
void addObservation(Idx iattr, GUM_SCALAR ivalue)
Comptabilizes the new observation.
const ContingencyTable< Idx, GUM_SCALAR > & ct() const
Returns contingency table (needed for the merging of GTestPolicy instances)
INLINE void emplace(Args &&... args)
ContingencyTable< Idx, GUM_SCALAR > _conTab_
The contingency table used to keeps records of all observation.
std::string toString() const
void * operator new(size_t s)
Allocators and Deallocators redefinition.
double secondaryscore() const
Returns a second criterion to severe ties.
<agrum/tools/multidim/core/testPolicies/GTestPolicy.h>
double score() const
Returns the performance of current variable according to the test.
bool isTestRelevant() const
Returns true if enough observation were made so that the test can be relevant.
void add(const GTestPolicy< GUM_SCALAR > &src)
Performs the merging of current GTestPolicy instance with given instance.
GTestPolicy()
Constructor.
void operator delete(void *p)
Constructor.