28 #ifndef GUM_LEARNING_INDEP_TEST_G2_H 29 #define GUM_LEARNING_INDEP_TEST_G2_H 31 #include <agrum/tools/core/math/chi2.h> 32 #include <agrum/tools/stattests/independenceTest.h> 33 #include <agrum/BN/learning/aprioris/aprioriNoApriori.h> 46 template <
template <
typename >
class ALLOC =
std::
allocator >
80 IndepTestG2(
const DBRowGeneratorParser< ALLOC >& parser,
81 const Apriori< ALLOC >& external_apriori,
104 IndepTestG2(
const DBRowGeneratorParser< ALLOC >& parser,
105 const Apriori< ALLOC >& apriori,
114 IndepTestG2(
const IndepTestG2< ALLOC >& from,
const allocator_type& alloc);
120 IndepTestG2(IndepTestG2< ALLOC >&& from,
const allocator_type& alloc);
161 virtual double score_(
const IdCondSet< ALLOC >& idset)
final;
166 #ifndef DOXYGEN_SHOULD_SKIP_THIS 176 const std::vector< Idx > _empty_set_;
186 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 187 extern template class gum::learning::IndepTestG2<>;
192 #include <agrum/tools/stattests/indepTestG2_tpl.h> IndepTestG2(IndepTestG2< ALLOC > &&from)
move constructor
IndepTestG2< ALLOC > & operator=(IndepTestG2< ALLOC > &&from)
move operator
IndepTestG2(IndepTestG2< ALLOC > &&from, const allocator_type &alloc)
move constructor with a given allocator
virtual IndepTestG2< ALLOC > * clone() const
virtual copy constructor
IndepTestG2(const DBRowGeneratorParser< ALLOC > &parser, const Apriori< ALLOC > &external_apriori, const std::vector< std::pair< std::size_t, std::size_t >, ALLOC< std::pair< std::size_t, std::size_t > > > &ranges, const Bijection< NodeId, std::size_t, ALLOC< std::size_t > > &nodeId2columns=Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(), const allocator_type &alloc=allocator_type())
default constructor
INLINE void emplace(Args &&... args)
IndepTestG2(const DBRowGeneratorParser< ALLOC > &parser, const Apriori< ALLOC > &apriori, const Bijection< NodeId, std::size_t, ALLOC< std::size_t > > &nodeId2columns=Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(), const allocator_type &alloc=allocator_type())
default constructor
std::pair< double, double > statistics_(const IdCondSet< ALLOC > &idset)
compute the pair <G2 statistic,pvalue>
the class for computing G2 independence test scores
virtual double score_(const IdCondSet< ALLOC > &idset) final
returns the score for a given IdCondSet
std::pair< double, double > statistics(NodeId var1, NodeId var2, const std::vector< NodeId, ALLOC< NodeId > > &rhs_ids={})
get the pair <G2statistic,pvalue> for a test var1 indep var2 given rhs_ids
IndepTestG2(const IndepTestG2< ALLOC > &from)
copy constructor
IndepTestG2(const IndepTestG2< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
virtual ~IndepTestG2()
destructor
virtual IndepTestG2< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
IndepTestG2< ALLOC > & operator=(const IndepTestG2< ALLOC > &from)
copy operator
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)