25 #ifndef GUM_LEARNING_A_PRIORI_H 26 #define GUM_LEARNING_A_PRIORI_H 46 template <
template <
typename >
class ALLOC = std::allocator >
98 virtual bool isOfType(
const std::string& type) = 0;
101 virtual const std::string&
getType()
const = 0;
121 std::vector<
double, ALLOC< double > >& counts) = 0;
130 std::vector<
double, ALLOC< double > >& counts) = 0;
virtual void setWeight(const double weight)
sets the weight of the a priori (kind of effective sample size)
virtual const std::string & getType() const =0
returns the type of the apriori
The class representing a tabular database stored in RAM.
the base class for all a prioris
virtual bool isOfType(const std::string &type)=0
indicates whether an apriori is of a certain type
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set...
the base class for all a priori
A class used by learning caches to represent uniquely sets of variables.
virtual void addConditioningApriori(const IdSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts)=0
adds the apriori to a counting vectordefined over the right hand side of the idset ...
gum is the global namespace for all aGrUM entities
const DatabaseTable< ALLOC > * _database
a reference to the database in order to have access to its variables
virtual Apriori< ALLOC > * clone() const =0
virtual copy constructor
virtual void addAllApriori(const IdSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts)=0
adds the apriori to a counting vector corresponding to the idset
double weight() const
returns the weight assigned to the apriori
double _weight
the weight of the apriori
Apriori< ALLOC > & operator=(const Apriori< ALLOC > &from)
copy operator
Set of pairs of elements with fast search for both elements.
the different types of apriori
The class representing a tabular database as used by learning tasks.
virtual bool isInformative() const =0
indicates whether the apriori is potentially informative
allocator_type getAllocator() const
returns the allocator used by the internal apriori
Bijection< NodeId, std::size_t, ALLOC< std::size_t > > _nodeId2columns
a mapping from the NodeIds of the variables to the indices of the columns in the database ...
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Size NodeId
Type for node ids.
Apriori(const DatabaseTable< ALLOC > &database, 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
Set of pairs of elements with fast search for both elements.
virtual ~Apriori()
destructor