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

the internal apriori for the K2 score: Laplace AprioriSome scores include an apriori. More...

#include <scoreInternalK2Apriori.h>

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

Public Member Functions

Constructors / Destructors
 ScoreInternalK2Apriori ()
 default constructor More...
 
virtual ScoreInternalK2Apriori< IdSetAlloc, CountAlloc > * copyFactory () const final
 virtual copy constructor More...
 
 ScoreInternalK2Apriori (const ScoreInternalK2Apriori< IdSetAlloc, CountAlloc > &from)
 copy constructor More...
 
 ScoreInternalK2Apriori (ScoreInternalK2Apriori< IdSetAlloc, CountAlloc > &&from)
 move constructor More...
 
virtual ~ScoreInternalK2Apriori ()
 destructor More...
 
Accessors / Modifiers
virtual void insertScoreApriori (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) final
 insert the internal score apriori into a set of countings More...
 
Accessors / Modifiers
virtual bool isInformative () const
 indicates whether the apriori is potentially informative More...
 

Detailed Description

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

the internal apriori for the K2 score: Laplace Apriori

Some scores include an apriori.

For instance, the K2 score is a BD score with a Laplace Apriori ( smoothing(1) ). BDeu is a BD score with a N'/(r_i * q_i) apriori, where N' is an effective sample size and r_i is the domain size of the target variable and q_i is the domain size of the Cartesian product of its parents. The goal of the score's internal apriori classes is to enable to account for these aprioris outside the score, e.g., when performing parameter estimation. It is important to note that, to be meaningfull a structure + parameter learning requires that the same aprioris are taken into account during structure learning and parameter learning.

Definition at line 68 of file scoreInternalK2Apriori.h.

Constructor & Destructor Documentation

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

default constructor

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

copy constructor

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

move constructor

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

destructor

Member Function Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual ScoreInternalK2Apriori< IdSetAlloc, CountAlloc >* gum::learning::ScoreInternalK2Apriori< IdSetAlloc, CountAlloc >::copyFactory ( ) const
finalvirtual
template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::ScoreInternalK2Apriori< IdSetAlloc, CountAlloc >::insertScoreApriori ( 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 
)
finalvirtual

insert the internal score apriori into a set of countings

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

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual bool gum::learning::ScoreInternalApriori< IdSetAlloc, CountAlloc >::isInformative ( ) const
virtualinherited

indicates whether the apriori is potentially informative

Basically, only the NoApriori is uninformative. However, it may happen that, under some circonstances, an apriori, which is usually not equal to the NoApriori, becomes equal to it. In this case, if the apriori can detect this case, it shall informa the classes that use it that it is temporarily uninformative. These classes will then be able to speed-up their code by avoiding to take into account the apriori in their computations.

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


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