aGrUM  0.13.2
gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > Class Template Reference

A dirichlet priori: computes its N'_ijk from a database. More...

#include <aprioriDirichletFromDatabase.h>

+ Inheritance diagram for gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >:
+ Collaboration diagram for gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >:

Public Member Functions

Constructors / Destructors
template<typename RowFilter >
 AprioriDirichletFromDatabase (const RowFilter &filter, const std::vector< Size > &var_modalities)
 default constructor More...
 
virtual AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > * copyFactory () const
 virtual copy constructor More...
 
virtual ~AprioriDirichletFromDatabase ()
 destructor More...
 
Accessors / Modifiers
virtual void compute () final
 include the apriori into a given set of counts More...
 
virtual bool isOfType (const std::string &type) final
 indicates whether an apriori is of a certain type More...
 
virtual const std::string & getType () const noexceptfinal
 returns the type of the apriori More...
 
Accessors / Modifiers
virtual void setWeight (double weight)
 sets the weight of the a priori (kind of effective sample size) More...
 
double weight () const noexcept
 returns the weight assigned to the apriori More...
 
void setParameters (const std::vector< Size > &modalities, std::vector< std::vector< double, CountAlloc > > &counts, const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &target_nodesets, const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &conditioning_nodesets)
 sets the parameters for the apriori More...
 
const std::vector< double, CountAlloc > & getAllApriori (Idx index)
 returns the apriori vector for a given (conditioned) target set More...
 
const std::vector< double, CountAlloc > & getConditioningApriori (Idx index)
 returns the apriori vector for a conditioning set More...
 

Public Types

using type = AprioriDirichletType
 

Protected Attributes

double _weight {1.0f}
 the weight of the apriori More...
 
const std::vector< Size > * _modalities {nullptr}
 the modalities of the nodes More...
 
std::vector< std::vector< double, CountAlloc > > * _unapriori_counts {nullptr}
 the counts that were performed by the class on which we add an apriori More...
 
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > * _target_nodesets {nullptr}
 the set of target + cond nodes, and their counting indices More...
 
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > * _conditioning_nodesets {nullptr}
 the set of conditioning nodesets More...
 
std::vector< std::vector< double, CountAlloc > > _apriori_counts
 the a priori More...
 

Protected Member Functions

 AprioriDirichletFromDatabase (const AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > &from)
 copy constructor More...
 
 AprioriDirichletFromDatabase (AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > &&from)
 move constructor More...
 
AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > & operator= (const AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > &)=delete
 prevent copy operator More...
 

Detailed Description

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
class gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >

A dirichlet priori: computes its N'_ijk from a database.

Definition at line 46 of file aprioriDirichletFromDatabase.h.

Member Typedef Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
using gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::type = AprioriDirichletType

Definition at line 50 of file aprioriDirichletFromDatabase.h.

Constructor & Destructor Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
template<typename RowFilter >
gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::AprioriDirichletFromDatabase ( const RowFilter &  filter,
const std::vector< Size > &  var_modalities 
)

default constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::~AprioriDirichletFromDatabase ( )
virtual

destructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::AprioriDirichletFromDatabase ( const AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > &  from)
protected

copy constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::AprioriDirichletFromDatabase ( AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > &&  from)
protected

move constructor

Member Function Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::Counter< IdSetAlloc, CountAlloc >::_count ( )
protectedinherited

perform the computation of the countings

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< double, CountAlloc >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_getAllCounts ( Idx  index)
protectedinherited

returns the counting vector for a given (conditioned) target set

This method returns the observtion countings for the set of variables whose index was returned by method addNodeSet or addNodeSet. If the set was conditioned, the countings correspond to the target variables and the conditioning variables. If you wish to get only the countings for the conditioning variables, prefer using method countConditioning.

Warning
the dimensions of the vector are as follows: first come the nodes of the conditioning set (in the order in which they were specified when callind addNodeset, and then the target nodes).
whenever you call this function, if the counts have not been computed yet, they are computed before the function returns.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< Idx, IdSetAlloc >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_getAllNodes ( Idx  index) const
protectednoexceptinherited

returns the set of target + conditioning nodes

conditioning nodes are always the first ones in the vector and targets are the last ones

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_getAllNodes ( ) const
protectednoexceptinherited

returns all the sets of target + cond nodes, and their counting indices

conditioning nodes are always the first ones in the vector and targets are the last ones

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< double, CountAlloc >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_getConditioningCounts ( Idx  index)
protectedinherited

returns the counting vector for a conditioning set

Warning
whenever you call this function, if the counts have not been computed yet, they are computed before the function returns.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< Idx, IdSetAlloc >* gum::learning::Counter< IdSetAlloc, CountAlloc >::_getConditioningNodes ( Idx  index) const
protectednoexceptinherited

returns the conditioning nodes (nullptr if there are no such nodes)

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_getConditioningNodes ( ) const
protectednoexceptinherited

returns all the sets of conditioning nodes

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::vector< double, CountAlloc > >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_getCounts ( )
protectednoexceptinherited

returns all the countings performed (both targets and conditioned)

this method returns the countings of the record counter. It should be used in conjunction with methods _getConditioningNodes () and _getTargetNodes () that indicate, for each nodeset, the index of the corresponding counting in the vector returned by _getCounts ().

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addEmptyNodeSet ( )
inherited

adds an empty set of variables to count

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( Idx  var)
inherited

add a new single variable to be counted

Parameters
varrepresents the index of the variable in the filtered rows produced by the database cell filters whose observations shall be counted
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores or independence tests. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the observed countings of "var" in this vector. The user shall pass this index as argument to methods _getAllCounts to get the corresponding counting vector.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( Idx  var1,
Idx  var2 
)
inherited

add a new target node conditioned by another node to be counted

Parameters
var1represents the index of the target variable in the filtered rows produced by the database cell filters
var2represents the index of the conditioning variable in the filtered rows produced by the database cell filters
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores or independence tests. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the counts in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the observed countings of (var2,var1) [in this order] and var2 respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( const std::pair< Idx, Idx > &  vars)
inherited

add a new target node conditioned by another node to be counted

Parameters
varscontains the index of the target variable (first) in the filtered rows produced by the database cell filters, and the index of the conditioning variable (second).
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the counts in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the observed countings of (vars.second, vars.first) [in this order] and vars.second respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( Idx  var,
const std::vector< Idx > &  conditioning_ids 
)
inherited

add a new target variable plus some conditioning vars

Parameters
varrepresents the index of the target variable in the filtered rows produced by the database cell filters
conditioning_idsthe indices of the variables of the conditioning set in the filtered rows
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores or independence tests. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the countings of (var | conditioning_ids) in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the counting vectors of (conditioning_ids,vars) [in this order] and conditioning_ids respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( Idx  var,
std::vector< Idx > &&  conditioning_ids 
)
inherited

add a new target variable plus some conditioning vars

Parameters
varrepresents the index of the target variable in the filtered rows produced by the database cell filters
conditioning_idsthe indices of the variables of the conditioning set in the filtered rows
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores or independence tests. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the countings of (var | conditioning_ids) in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the counting vectors of (conditioning_ids,vars) [in this order] and conditioning_ids respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( Idx  var1,
Idx  var2,
const std::vector< Idx > &  conditioning_ids 
)
inherited

add a target conditioned by other variables to be counted

Parameters
var1represents the index of the target variable in the filtered rows produced by the database cell filters
var2represents the index of the last conditioning variable in the filtered rows produced by the database cell filters
conditioning_idsthe indices of the variables of the conditioning set in the filtered rows (minus var2, which is subsequently apended to it).
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the counts in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the countings of (conditioning_ids, var2, var1) [in this order] and (conditioning_ids, var2) [in this order] respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( Idx  var1,
Idx  var2,
std::vector< Idx > &&  conditioning_ids 
)
inherited

add a target conditioned by other variables to be counted

Parameters
var1represents the index of the target variable in the filtered rows produced by the database cell filters
var2represents the index of the last conditioning variable in the filtered rows produced by the database cell filters
conditioning_idsthe indices of the variables of the conditioning set in the filtered rows (minus var2, which is subsequently apended to it).
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the counts in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the countings of (conditioning_ids, var2, var1) [in this order] and (conditioning_ids, var2) [in this order] respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( const std::pair< Idx, Idx > &  vars,
const std::vector< Idx > &  conditioning_ids 
)
inherited

add a target conditioned by other variables to be counted

Parameters
varsrepresents the index of the target variable (first) in the filtered rows produced by the database cell filters, and the index of the last conditioning variable (second)
conditioning_idsthe indices of the variables of the conditioning set in the filtered rows (minus vars.second which is appended to it)
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the counts in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the observed countings of (conditioning_ids, vars.second, vars.first) [in this order] and (conditioning_ids, vars.second) [in this order] respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
Idx gum::learning::Counter< IdSetAlloc, CountAlloc >::addNodeSet ( const std::pair< Idx, Idx > &  vars,
std::vector< Idx > &&  conditioning_ids 
)
inherited

add a target conditioned by other variables to be counted

Parameters
varsrepresents the index of the target variable (first) in the filtered rows produced by the database cell filters, and the index of the last conditioning variable (second)
conditioning_idsthe indices of the variables of the conditioning set in the filtered rows (minus vars.second which is appended to it)
Returns
the index of the produced counting vector: the user should use class Counter to compute in one pass several scores. These and their corresponding countings in the database are stored into a vector and the value returned by method addNodeSet is the index of the counts in this vector. The user shall pass this index as argument to methods _getAllCounts and _getConditioningCounts to get the observed countings of (conditioning_ids, vars.second, vars.first) [in this order] and (conditioning_ids, vars.second) [in this order] respectively.
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::Counter< IdSetAlloc, CountAlloc >::clear ( )
inherited

clears all the data structures from memory

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::compute ( )
finalvirtual

include the apriori into a given set of counts

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >* gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::copyFactory ( ) const
virtual

virtual copy constructor

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< double, CountAlloc >& gum::learning::Apriori< IdSetAlloc, CountAlloc >::getAllApriori ( Idx  index)
inherited

returns the apriori vector for a given (conditioned) target set

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< double, CountAlloc >& gum::learning::Apriori< IdSetAlloc, CountAlloc >::getConditioningApriori ( Idx  index)
inherited

returns the apriori vector for a conditioning set

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual const std::string& gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::getType ( ) const
finalvirtualnoexcept

returns the type of the apriori

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual bool gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::isOfType ( const std::string &  type)
finalvirtual

indicates whether an apriori is of a certain type

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< Size >& gum::learning::Counter< IdSetAlloc, CountAlloc >::modalities ( ) const
noexceptinherited

returns the modalities of the variables

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >& gum::learning::AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc >::operator= ( const AprioriDirichletFromDatabase< IdSetAlloc, CountAlloc > &  )
protecteddelete

prevent copy operator

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::Counter< IdSetAlloc, CountAlloc >::setMaxNbThreads ( Size  nb)
noexceptinherited

sets the maximum number of threads used to perform countings

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::Apriori< IdSetAlloc, CountAlloc >::setParameters ( const std::vector< Size > &  modalities,
std::vector< std::vector< double, CountAlloc > > &  counts,
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &  target_nodesets,
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &  conditioning_nodesets 
)
inherited

sets the parameters for the apriori

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::Counter< IdSetAlloc, CountAlloc >::setRange ( Size  min_range,
Size  max_range 
)
inherited

sets the range of records taken into account by the counter

Parameters
min_rangehe number of the first record to be taken into account during learning
max_rangethe number of the record after the last one taken into account
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::Apriori< IdSetAlloc, CountAlloc >::setWeight ( double  weight)
virtualinherited

sets the weight of the a priori (kind of effective sample size)

Reimplemented in gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >.

Referenced by gum::learning::genericBNLearner::__createApriori().

+ Here is the caller graph for this function:

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
double gum::learning::Apriori< IdSetAlloc, CountAlloc >::weight ( ) const
noexceptinherited

returns the weight assigned to the apriori

Member Data Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const double gum::learning::Counter< IdSetAlloc, CountAlloc >::_1log2 {M_LOG2E}
protectedinherited

1 / log(2)

Definition at line 342 of file counter.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::vector< double, CountAlloc > > gum::learning::Apriori< IdSetAlloc, CountAlloc >::_apriori_counts
protectedinherited

the a priori

Definition at line 130 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_conditioning_nodesets {nullptr}
protectedinherited

the set of conditioning nodesets

for details, see _target_nodesets

Definition at line 127 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* > gum::learning::Counter< IdSetAlloc, CountAlloc >::_conditioning_nodesets
protectedinherited

the conditioning id sets to count and their indices in the record counter

Definition at line 361 of file counter.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
bool gum::learning::Counter< IdSetAlloc, CountAlloc >::_counts_computed {false}
protectedinherited

indicates whether we have already computed the countings of the nodesets

Definition at line 349 of file counter.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< Size >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_modalities {nullptr}
protectedinherited

the modalities of the nodes

Definition at line 105 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< Size >& gum::learning::Counter< IdSetAlloc, CountAlloc >::_modalities
protectedinherited

the modalities of the variables

Definition at line 345 of file counter.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
RecordCounter< IdSetAlloc, CountAlloc > gum::learning::Counter< IdSetAlloc, CountAlloc >::_record_counter
protectedinherited

the recordCounter that will parse the database

Definition at line 352 of file counter.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_target_nodesets {nullptr}
protectedinherited

the set of target + cond nodes, and their counting indices

The first element of the pairs correspond to a nodeset and the second one to the corresponding index in _unapriori_counts. Some pointers on the pair might be nullptr. In this case, this means that the countings have already been processed and have been put into a cache. So, for these pointers, no a priori operation needs be performed.

Definition at line 122 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* > gum::learning::Counter< IdSetAlloc, CountAlloc >::_target_nodesets
protectedinherited

the target id sets to count and their indices in the record counter

Definition at line 356 of file counter.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::vector< double, CountAlloc > >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_unapriori_counts {nullptr}
protectedinherited

the counts that were performed by the class on which we add an apriori

Say that a score needs an apriori, then _unapriori_counts corresponds to the countings performed by the score. Those are given to the apriori so that the latter can add what is needed to _unapriori_counts to take into account the so-called apriori.

Definition at line 112 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
double gum::learning::Apriori< IdSetAlloc, CountAlloc >::_weight {1.0f}
protectedinherited

the weight of the apriori

Definition at line 102 of file apriori.h.


The documentation for this class was generated from the following file: