aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
gum::learning::IKTBNLearner< GUM_SCALAR > Class Template Referenceabstract

Pure-virtual configuration interface shared by all k-TBN learners. More...

#include <agrum/KTBN/learning/IKTBNLearner.h>

Inheritance diagram for gum::learning::IKTBNLearner< GUM_SCALAR >:
[legend]

Public Member Functions

virtual ~IKTBNLearner ()=default
 virtual destructor (polymorphic base class)
Main learning method
virtual KTBN< GUM_SCALAR > learnKTBN ()=0
 Learn a k-TBN (structure + CPTs) with the recorded configuration. The fixed-k learner learns for its single k; the adaptive learner also selects the best k in [2, kMax].
Score selection
virtual IKTBNLearner< GUM_SCALAR > & useScoreAIC ()=0
virtual IKTBNLearner< GUM_SCALAR > & useScoreBD ()=0
virtual IKTBNLearner< GUM_SCALAR > & useScoreBDeu ()=0
virtual IKTBNLearner< GUM_SCALAR > & useScoreBIC ()=0
virtual IKTBNLearner< GUM_SCALAR > & useScoreLog2Likelihood ()=0
virtual IKTBNLearner< GUM_SCALAR > & useScoreMDL ()=0
virtual void useScorefNML ()=0
Algorithm selection
virtual IKTBNLearner< GUM_SCALAR > & useGreedyHillClimbing ()=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
virtual IKTBNLearner< GUM_SCALAR > & useExtendedGreedyHillClimbing ()=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
virtual IKTBNLearner< GUM_SCALAR > & useLocalSearchWithTabuList (Size tabu_size, Size nb_decrease)=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
IKTBNLearner< GUM_SCALAR > & useLocalSearchWithTabuList (Size tabu_size)
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
IKTBNLearner< GUM_SCALAR > & useLocalSearchWithTabuList ()
 local search with tabu list and the default parameters (keys tabuListSize and tabuNbDecrease of the section learning of gum::Configuration)
virtual IKTBNLearner< GUM_SCALAR > & useMIIC ()=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
virtual IKTBNLearner< GUM_SCALAR > & useGreedyThickThinning ()=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
virtual IKTBNLearner< GUM_SCALAR > & usePC ()=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
virtual IKTBNLearner< GUM_SCALAR > & useFCI ()=0
 local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)
MIIC correction
virtual IKTBNLearner< GUM_SCALAR > & useNMLCorrection ()=0
virtual IKTBNLearner< GUM_SCALAR > & useMDLCorrection ()=0
virtual IKTBNLearner< GUM_SCALAR > & useNoCorrection ()=0
Prior selection
virtual IKTBNLearner< GUM_SCALAR > & useSmoothingPrior (double weight)=0
 smoothing prior with the default weight (key priorWeight of the section learning of gum::Configuration)
IKTBNLearner< GUM_SCALAR > & useSmoothingPrior ()
 smoothing prior with the default weight (key priorWeight of the section learning of gum::Configuration)
Structural constraints (by name only)
virtual IKTBNLearner< GUM_SCALAR > & addForbiddenArc (std::string_view tailNode, std::string_view headNode)=0
 Forbid tailNode -> headNode (engine names, e.g. "X[1]", "C").
virtual IKTBNLearner< GUM_SCALAR > & addForbiddenArc (std::string_view tailBase, int tailSlice, std::string_view headBase, int headSlice)=0
 Forbid one (base, slice) -> (base, slice) arc (KTBN::ATEMPORAL for static).
virtual IKTBNLearner< GUM_SCALAR > & eraseForbiddenArc (std::string_view tailNode, std::string_view headNode)=0
 Undo a previous addForbiddenArc (engine names).
virtual IKTBNLearner< GUM_SCALAR > & eraseForbiddenArc (std::string_view tailBase, int tailSlice, std::string_view headBase, int headSlice)=0
 Undo a previous addForbiddenArc for a specific (base, slice) pair.
virtual IKTBNLearner< GUM_SCALAR > & addMandatoryArc (std::string_view tailNode, std::string_view headNode)=0
 Force tailNode to be a parent of headNode (engine names).
virtual IKTBNLearner< GUM_SCALAR > & addMandatoryArc (std::string_view tailBase, int tailSlice, std::string_view headBase, int headSlice)=0
 Force one arc, lag stated explicitly via slices (KTBN::ATEMPORAL for static).
virtual IKTBNLearner< GUM_SCALAR > & eraseMandatoryArc (std::string_view tailNode, std::string_view headNode)=0
 Undo a previous addMandatoryArc (engine names).
virtual IKTBNLearner< GUM_SCALAR > & eraseMandatoryArc (std::string_view tailBase, int tailSlice, std::string_view headBase, int headSlice)=0
 Undo a previous addMandatoryArc.
virtual IKTBNLearner< GUM_SCALAR > & addForbiddenIntraSliceArc (std::string_view tailBase, std::string_view headBase)=0
 Forbid tailBase -> headBase at every intra-slice position.
virtual IKTBNLearner< GUM_SCALAR > & eraseForbiddenIntraSliceArc (std::string_view tailBase, std::string_view headBase)=0
 Undo a previous addForbiddenIntraSliceArc.
virtual IKTBNLearner< GUM_SCALAR > & addForbiddenArcAllSlices (std::string_view tailBase, std::string_view headBase)=0
 Forbid tailBase -> headBase at every causally-possible slice pair.
virtual IKTBNLearner< GUM_SCALAR > & eraseForbiddenArcAllSlices (std::string_view tailBase, std::string_view headBase)=0
 Undo a previous addForbiddenArcAllSlices.
virtual IKTBNLearner< GUM_SCALAR > & addNoParentNode (std::string_view base, int slice)=0
 Declare a single (base, slice) node as a root (no parents).
virtual IKTBNLearner< GUM_SCALAR > & addNoParentNode (std::string_view name)=0
 Declare a single node (bracket notation, e.g. "X[2]" or "C") as a root.
virtual IKTBNLearner< GUM_SCALAR > & eraseNoParentNode (std::string_view base, int slice)=0
 Undo a previous addNoParentNode for a single (base, slice) node.
virtual IKTBNLearner< GUM_SCALAR > & eraseNoParentNode (std::string_view name)=0
 Undo addNoParentNode for a node given by bracket notation.
virtual IKTBNLearner< GUM_SCALAR > & addNoChildrenNode (std::string_view base, int slice)=0
 Declare a single (base, slice) node as a leaf (no children).
virtual IKTBNLearner< GUM_SCALAR > & addNoChildrenNode (std::string_view name)=0
 Declare a single node (bracket notation, e.g. "X[2]" or "C") as a leaf.
virtual IKTBNLearner< GUM_SCALAR > & eraseNoChildrenNode (std::string_view base, int slice)=0
 Undo a previous addNoChildrenNode for a single (base, slice) node.
virtual IKTBNLearner< GUM_SCALAR > & eraseNoChildrenNode (std::string_view name)=0
 Undo addNoChildrenNode for a node given by bracket notation.
virtual IKTBNLearner< GUM_SCALAR > & addPossibleEdge (std::string_view tailBase, int tailSlice, std::string_view headBase, int headSlice)=0
 Add a candidate edge for MIIC (only edges explicitly listed are explored).
virtual IKTBNLearner< GUM_SCALAR > & addPossibleEdge (std::string_view tail, std::string_view head)=0
 Add a candidate edge for MIIC using engine names (e.g. "X[1]", "C").
virtual IKTBNLearner< GUM_SCALAR > & erasePossibleEdge (std::string_view tailBase, int tailSlice, std::string_view headBase, int headSlice)=0
 Undo a previous addPossibleEdge.
virtual IKTBNLearner< GUM_SCALAR > & erasePossibleEdge (std::string_view tail, std::string_view head)=0
 Undo a previous addPossibleEdge using engine names (e.g. "X[1]", "C").
virtual IKTBNLearner< GUM_SCALAR > & allowArcAdditions (bool allow=true)=0
 Allow or forbid arc additions during structure search.
virtual IKTBNLearner< GUM_SCALAR > & allowArcDeletions (bool allow=true)=0
 Allow or forbid arc deletions during structure search.
virtual IKTBNLearner< GUM_SCALAR > & allowArcReversals (bool allow=true)=0
 Allow or forbid arc reversals during structure search.
virtual IKTBNLearner< GUM_SCALAR > & setMaxIndegree (Size max_indegree)=0
 Cap the number of parents of any single node.

Static Protected Member Functions

Default parameters (keys of the section <tt>learning</tt> of gum::Configuration)
static Size defaultTabuListSize_ ()
static Size defaultTabuNbDecrease_ ()
static double defaultPriorWeight_ ()

Name encoding: (base, slice) <-> engine name

static void _checkMinimalOrder_ (Size order, std::string_view label)
 Throw InvalidArgument unless order is at least 2, label naming the offending parameter ("k" for the fixed-k learner, "kMax" for the adaptive one).
static std::unordered_set< std::string > _scanConstantColumns_ (std::string_view dirPath, std::string_view csvBaseName, Size nbSamples, const std::vector< std::string > &missingSymbols)
 Scans every trajectory and returns the base names classified atemporal: those whose value never changes across the rows of a single trajectory (checked independently per trajectory, so the value may still differ between trajectories). Shared by every atemporal-inferring CSV constructor (KTBNLearner, KTBNAdaptiveLearner): identical scanning logic regardless of which subclass calls it, so duplicating it per subclass would only invite the two copies to drift. Callers are responsible for validating their own arguments (e.g. k/kMax >= 2) before calling this — it does no such check itself, only opens files, so a bad argument would otherwise only be caught after a wasted scan.
virtual const std::unordered_set< std::string > & _atemporalVarNames_ () const =0
 The base names of the atemporal (static) variables. The only subclass-specific input to determineNode(): the fixed-k learner reads it from its prior k-TBN, the adaptive learner from the atemporal set recorded at construction.
virtual bool _isKnownBase_ (std::string_view base) const =0
 Whether base is one of this learner's variables, temporal or atemporal. The second subclass-specific input to the shared helpers. A predicate rather than a temporalVarNames() counterpart to atemporalVarNames(): the adaptive learner holds the base names and the atemporal ones but never a temporal-only set, and would have to materialise and cache a third one just to return a reference.
std::string _encode_ (std::string_view base, int slice) const
 (base, slice) -> engine name ("A[1]" / atemporal engine name). Pure function, shared by every learner.
std::pair< std::string, int > _determineNode_ (const std::string &name) const
 engine name -> (base, slice); atemporal names map to KTBN::ATEMPORAL. Shared by every learner; only the atemporal test varies (via atemporalVarNames()).
void _checkArcTemporallyFeasible_ (std::string_view tail, std::string_view head, std::string_view action) const
 Reject an arc the k-TBN definition can never contain, so eraseForbiddenArc and addMandatoryArc both fail early (before any internal learner is touched) with a uniform message. action is the verb phrase completing "cannot <action> <tail> -> <head>: ..." (e.g. "force the mandatory arc", "un-forbid the arc"). Two arcs are refused: a temporal -> atemporal arc (a time-varying variable can never parent a static one) and a backward-in-time arc (head strictly before tail).
void _checkBaseIsTemporal_ (std::string_view base, std::string_view context) const
 Throw InvalidArgument unless base is a known temporal base. context completes "cannot appear in <context>" (e.g. "an intra-slice constraint", "a kernel-relative arc"): every caller rejects an atemporal base for the same underlying reason – it has no per-slice instance – so they share the sentence and vary the setting.

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::learning::IKTBNLearner< GUM_SCALAR >

Pure-virtual configuration interface shared by all k-TBN learners.

See also
gum::learning::KTBNLearner (fixed k), gum::learning::KTBNAdaptiveLearner (k is learned too).

Definition at line 110 of file IKTBNLearner.h.

Constructor & Destructor Documentation

◆ ~IKTBNLearner()

template<GUM_Numeric GUM_SCALAR>
virtual gum::learning::IKTBNLearner< GUM_SCALAR >::~IKTBNLearner ( )
virtualdefault

virtual destructor (polymorphic base class)

Member Function Documentation

◆ _atemporalVarNames_()

template<GUM_Numeric GUM_SCALAR>
virtual const std::unordered_set< std::string > & gum::learning::IKTBNLearner< GUM_SCALAR >::_atemporalVarNames_ ( ) const
protectedpure virtual

The base names of the atemporal (static) variables. The only subclass-specific input to determineNode(): the fixed-k learner reads it from its prior k-TBN, the adaptive learner from the atemporal set recorded at construction.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

Referenced by _checkBaseIsTemporal_(), and _determineNode_().

Here is the caller graph for this function:

◆ _checkArcTemporallyFeasible_()

template<GUM_Numeric GUM_SCALAR>
void gum::learning::IKTBNLearner< GUM_SCALAR >::_checkArcTemporallyFeasible_ ( std::string_view tail,
std::string_view head,
std::string_view action ) const
protected

Reject an arc the k-TBN definition can never contain, so eraseForbiddenArc and addMandatoryArc both fail early (before any internal learner is touched) with a uniform message. action is the verb phrase completing "cannot <action> <tail> -> <head>: ..." (e.g. "force the mandatory arc", "un-forbid the arc"). Two arcs are refused: a temporal -> atemporal arc (a time-varying variable can never parent a static one) and a backward-in-time arc (head strictly before tail).

Definition at line 127 of file IKTBNLearner_tpl.h.

129 {
134 "cannot " << action << " " << tail << " -> " << head
135 << ": a temporal variable can never be a parent of an atemporal one; "
136 "this constraint is part of the k-TBN definition")
139 "cannot " << action << " " << tail << " -> " << head
140 << ": its head is at an earlier time slice than its tail, which "
141 "violates temporal causality")
142 }
Pure-virtual configuration interface shared by all k-TBN learners.
std::pair< std::string, int > _determineNode_(const std::string &name) const
engine name -> (base, slice); atemporal names map to KTBN::ATEMPORAL. Shared by every learner; only t...

References _determineNode_(), gum::KTBN< GUM_SCALAR >::ATEMPORAL, and GUM_ERROR.

Referenced by _isKnownBase_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addMandatoryArc(), gum::learning::KTBNLearner< GUM_SCALAR >::addMandatoryArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseForbiddenArc(), and gum::learning::KTBNLearner< GUM_SCALAR >::eraseForbiddenArc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _checkBaseIsTemporal_()

template<GUM_Numeric GUM_SCALAR>
void gum::learning::IKTBNLearner< GUM_SCALAR >::_checkBaseIsTemporal_ ( std::string_view base,
std::string_view context ) const
protected

Throw InvalidArgument unless base is a known temporal base. context completes "cannot appear in <context>" (e.g. "an intra-slice constraint", "a kernel-relative arc"): every caller rejects an atemporal base for the same underlying reason – it has no per-slice instance – so they share the sentence and vary the setting.

Definition at line 228 of file IKTBNLearner_tpl.h.

229 {
230 const std::string b{base};
231 if (!_isKnownBase_(b))
233 "unknown base variable '" << base
234 << "': it is not one of this learner's variables")
237 "atemporal variable '" << base << "' cannot appear in " << context
238 << ": it has no per-slice instance")
239 }
virtual bool _isKnownBase_(std::string_view base) const =0
Whether base is one of this learner's variables, temporal or atemporal. The second subclass-specific ...
virtual const std::unordered_set< std::string > & _atemporalVarNames_() const =0
The base names of the atemporal (static) variables. The only subclass-specific input to determineNode...

References _atemporalVarNames_(), _isKnownBase_(), gum::contains(), and GUM_ERROR.

Referenced by _isKnownBase_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::_verifyKernelArc_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addForbiddenIntraSliceArc(), gum::learning::KTBNLearner< GUM_SCALAR >::addForbiddenIntraSliceArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseForbiddenIntraSliceArc(), and gum::learning::KTBNLearner< GUM_SCALAR >::eraseForbiddenIntraSliceArc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _checkMinimalOrder_()

template<GUM_Numeric GUM_SCALAR>
void gum::learning::IKTBNLearner< GUM_SCALAR >::_checkMinimalOrder_ ( Size order,
std::string_view label )
staticprotected

Throw InvalidArgument unless order is at least 2, label naming the offending parameter ("k" for the fixed-k learner, "kMax" for the adaptive one).

This is a learner constraint, not a model one – gum::KTBN, gum::KTBNGenerator and gum::KTBNInference all accept k = 1 – which is why it lives here rather than on the model. Static because four of its call sites are themselves static helpers invoked from member-initialiser lists, before any object exists.

Definition at line 242 of file IKTBNLearner_tpl.h.

242 {
243 if (order < 2)
245 "a k-TBN learner requires "
246 << label << " >= 2: k=1 is a static Bayesian network, use BNLearner instead")
247 }

References GUM_ERROR.

Referenced by gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::KTBNAdaptiveLearner(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::KTBNAdaptiveLearner(), gum::learning::KTBNLearner< GUM_SCALAR >::_buildPriorFromBN_(), gum::learning::KTBNLearner< GUM_SCALAR >::_buildPriorFromCSV_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::_inferAtemporalVars_(), gum::learning::KTBNLearner< GUM_SCALAR >::_inferAtemporalVars_(), and _isKnownBase_().

Here is the caller graph for this function:

◆ _determineNode_()

template<GUM_Numeric GUM_SCALAR>
std::pair< std::string, int > gum::learning::IKTBNLearner< GUM_SCALAR >::_determineNode_ ( const std::string & name) const
protected

engine name -> (base, slice); atemporal names map to KTBN::ATEMPORAL. Shared by every learner; only the atemporal test varies (via atemporalVarNames()).

Definition at line 96 of file IKTBNLearner_tpl.h.

96 {
97 // check atemporal set first: a name registered as atemporal always maps
98 // to ATEMPORAL, even if it syntactically looks like "base[t]"
100
101 // syntactic parse: look for a trailing "[digits]" suffix
102 const std::size_t bracketPos = name.rfind('[');
104
106 name.size() - bracketPos - 1};
107 if (bracketContent.empty() || bracketContent.back() != ']')
109
110 const std::string_view digits = bracketContent.substr(0, bracketContent.size() - 1);
111 if (digits.empty()) return {name, KTBN< GUM_SCALAR >::ATEMPORAL};
112 for (const char c: digits)
113 if (std::isdigit(static_cast< unsigned char >(c)) == 0)
115
116 int slice{};
117 try {
119 } catch (const std::out_of_range&) {
121 "Node name '" << name << "' has a slice index too large to represent as int.")
122 }
123 return {name.substr(0, bracketPos), slice};
124 }

References _atemporalVarNames_(), gum::KTBN< GUM_SCALAR >::ATEMPORAL, gum::contains(), and GUM_ERROR.

Referenced by gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::_applyConstraints_(), _checkArcTemporallyFeasible_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::_forEachScoredNode_(), gum::learning::KTBNLearner< GUM_SCALAR >::_forOwningLearner_(), _isKnownBase_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::_recomputeKMin_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addForbiddenArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addMandatoryArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addNoChildrenNode(), gum::learning::KTBNLearner< GUM_SCALAR >::addNoChildrenNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addNoParentNode(), gum::learning::KTBNLearner< GUM_SCALAR >::addNoParentNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addPossibleEdge(), gum::learning::KTBNLearner< GUM_SCALAR >::addPossibleEdge(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseForbiddenArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseMandatoryArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseNoChildrenNode(), gum::learning::KTBNLearner< GUM_SCALAR >::eraseNoChildrenNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseNoParentNode(), gum::learning::KTBNLearner< GUM_SCALAR >::eraseNoParentNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::erasePossibleEdge(), gum::learning::KTBNLearner< GUM_SCALAR >::erasePossibleEdge(), and gum::learning::KTBNLearner< GUM_SCALAR >::names().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _encode_()

template<GUM_Numeric GUM_SCALAR>
std::string gum::learning::IKTBNLearner< GUM_SCALAR >::_encode_ ( std::string_view base,
int slice ) const
protected

(base, slice) -> engine name ("A[1]" / atemporal engine name). Pure function, shared by every learner.

Definition at line 89 of file IKTBNLearner_tpl.h.

89 {
91 return std::string{base} + '[' + std::to_string(slice) + ']';
92 }

References gum::KTBN< GUM_SCALAR >::ATEMPORAL.

Referenced by gum::learning::KTBNLearner< GUM_SCALAR >::_assemble_(), gum::learning::KTBNLearner< GUM_SCALAR >::_build_(), _isKnownBase_(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addForbiddenArc(), gum::learning::KTBNLearner< GUM_SCALAR >::addForbiddenArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addMandatoryArc(), gum::learning::KTBNLearner< GUM_SCALAR >::addMandatoryArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addNoChildrenNode(), gum::learning::KTBNLearner< GUM_SCALAR >::addNoChildrenNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addNoParentNode(), gum::learning::KTBNLearner< GUM_SCALAR >::addNoParentNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::addPossibleEdge(), gum::learning::KTBNLearner< GUM_SCALAR >::addPossibleEdge(), gum::learning::KTBNLearner< GUM_SCALAR >::domainSize(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseForbiddenArc(), gum::learning::KTBNLearner< GUM_SCALAR >::eraseForbiddenArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseMandatoryArc(), gum::learning::KTBNLearner< GUM_SCALAR >::eraseMandatoryArc(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseNoChildrenNode(), gum::learning::KTBNLearner< GUM_SCALAR >::eraseNoChildrenNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::eraseNoParentNode(), gum::learning::KTBNLearner< GUM_SCALAR >::eraseNoParentNode(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::erasePossibleEdge(), gum::learning::KTBNLearner< GUM_SCALAR >::erasePossibleEdge(), and gum::learning::KTBNLearner< GUM_SCALAR >::learnParameters().

Here is the caller graph for this function:

◆ _isKnownBase_()

template<GUM_Numeric GUM_SCALAR>
virtual bool gum::learning::IKTBNLearner< GUM_SCALAR >::_isKnownBase_ ( std::string_view base) const
protectedpure virtual

Whether base is one of this learner's variables, temporal or atemporal. The second subclass-specific input to the shared helpers. A predicate rather than a temporalVarNames() counterpart to atemporalVarNames(): the adaptive learner holds the base names and the atemporal ones but never a temporal-only set, and would have to materialise and cache a third one just to return a reference.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

References _checkArcTemporallyFeasible_(), _checkBaseIsTemporal_(), _checkMinimalOrder_(), _determineNode_(), _encode_(), and _scanConstantColumns_().

Referenced by _checkBaseIsTemporal_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _scanConstantColumns_()

template<GUM_Numeric GUM_SCALAR>
std::unordered_set< std::string > gum::learning::IKTBNLearner< GUM_SCALAR >::_scanConstantColumns_ ( std::string_view dirPath,
std::string_view csvBaseName,
Size nbSamples,
const std::vector< std::string > & missingSymbols )
staticprotected

Scans every trajectory and returns the base names classified atemporal: those whose value never changes across the rows of a single trajectory (checked independently per trajectory, so the value may still differ between trajectories). Shared by every atemporal-inferring CSV constructor (KTBNLearner, KTBNAdaptiveLearner): identical scanning logic regardless of which subclass calls it, so duplicating it per subclass would only invite the two copies to drift. Callers are responsible for validating their own arguments (e.g. k/kMax >= 2) before calling this — it does no such check itself, only opens files, so a bad argument would otherwise only be caught after a wasted scan.

Column indices still "live" (not yet proven non-constant) are tracked as a shrinking list rather than rescanned from scratch, and scanning stops opening further trajectories once that list is empty — falsification is one-way, so nothing left to test can ever become atemporal again.

Definition at line 145 of file IKTBNLearner_tpl.h.

149 {
150 namespace fs = std::filesystem;
151 const fs::path dir{dirPath};
154
155 std::vector< std::string > header; // captured from trajectory 1
156 std::vector< std::size_t > candidates; // column indices not yet falsified; shrinks only
157 std::vector< std::string > firstSeen; // per column: first non-missing value THIS trajectory
159 haveFirstSeen; // per column: whether firstSeen[c] is set THIS trajectory
160
161 for (Size i = 0; i < nbSamples; ++i) {
162 // once every column has been falsified, nothing left to test can
163 // ever become atemporal again, so remaining trajectories are never
164 // even opened. Not part of the for-condition: `candidates` does not
165 // exist yet before trajectory 1 populates it.
166 if (i > 0 && candidates.empty()) break;
167
168 const fs::path file = dir / (stem + std::to_string(i + 1) + ".csv");
170 if (!is.is_open()) GUM_ERROR(IOError, "Cannot open " << file.string());
171
172 CSVParser parser(is, file.string());
173 parser.next();
174 const auto& raw = parser.current();
175
176 if (i == 0) {
177 header.assign(raw.begin(), raw.end());
178 candidates.resize(header.size());
179 std::iota(candidates.begin(), candidates.end(), std::size_t{0});
180 } else {
181 bool same = (raw.size() == header.size());
182 for (std::size_t c = 0; same && c < header.size(); ++c)
183 same = (raw[c] == header[c]);
184 if (!same)
186 "Header of " << file.string() << " differs from trajectory 1");
187 }
188
189 haveFirstSeen.assign(header.size(), false);
190 firstSeen.assign(header.size(), {});
191
192 while (parser.next()) {
193 const auto& tokens = parser.current();
194 if (tokens.size() != header.size())
196 "Trajectory " << (i + 1) << ", row " << parser.nbLine() << ": expected "
197 << header.size() << " columns, got " << tokens.size());
198 // iterate only the still-live candidates, swap-erasing any just
199 // falsified so later rows (and later trajectories) never revisit it
200 for (std::size_t idx = 0; idx < candidates.size();) {
201 const std::size_t c = candidates[idx];
202 if (missing.contains(tokens[c])) {
203 ++idx; // uninformative row for this column, still a candidate
204 continue;
205 }
206 if (!haveFirstSeen[c]) {
207 firstSeen[c] = tokens[c];
208 haveFirstSeen[c] = true;
209 ++idx;
210 } else if (tokens[c] != firstSeen[c]) {
211 candidates[idx] = candidates.back(); // falsified: drop, O(1)
212 candidates.pop_back();
213 } else {
214 ++idx;
215 }
216 }
217 if (candidates.empty()) break; // nothing left to test in this file either
218 }
219 }
220
222 for (const std::size_t c: candidates)
223 atemporalVars.insert(header[c]);
224 return atemporalVars;
225 }

References gum::learning::CSVParser::current(), GUM_ERROR, gum::learning::CSVParser::nbLine(), and gum::learning::CSVParser::next().

Referenced by gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::_inferAtemporalVars_(), gum::learning::KTBNLearner< GUM_SCALAR >::_inferAtemporalVars_(), and _isKnownBase_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addForbiddenArc() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addForbiddenArc ( std::string_view tailBase,
int tailSlice,
std::string_view headBase,
int headSlice )
pure virtual

Forbid one (base, slice) -> (base, slice) arc (KTBN::ATEMPORAL for static).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addForbiddenArc() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addForbiddenArc ( std::string_view tailNode,
std::string_view headNode )
pure virtual

Forbid tailNode -> headNode (engine names, e.g. "X[1]", "C").

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addForbiddenArcAllSlices()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addForbiddenArcAllSlices ( std::string_view tailBase,
std::string_view headBase )
pure virtual

Forbid tailBase -> headBase at every causally-possible slice pair.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addForbiddenIntraSliceArc()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addForbiddenIntraSliceArc ( std::string_view tailBase,
std::string_view headBase )
pure virtual

Forbid tailBase -> headBase at every intra-slice position.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addMandatoryArc() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addMandatoryArc ( std::string_view tailBase,
int tailSlice,
std::string_view headBase,
int headSlice )
pure virtual

Force one arc, lag stated explicitly via slices (KTBN::ATEMPORAL for static).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addMandatoryArc() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addMandatoryArc ( std::string_view tailNode,
std::string_view headNode )
pure virtual

Force tailNode to be a parent of headNode (engine names).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addNoChildrenNode() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addNoChildrenNode ( std::string_view base,
int slice )
pure virtual

Declare a single (base, slice) node as a leaf (no children).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addNoChildrenNode() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addNoChildrenNode ( std::string_view name)
pure virtual

Declare a single node (bracket notation, e.g. "X[2]" or "C") as a leaf.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addNoParentNode() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addNoParentNode ( std::string_view base,
int slice )
pure virtual

Declare a single (base, slice) node as a root (no parents).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addNoParentNode() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addNoParentNode ( std::string_view name)
pure virtual

Declare a single node (bracket notation, e.g. "X[2]" or "C") as a root.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addPossibleEdge() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addPossibleEdge ( std::string_view tail,
std::string_view head )
pure virtual

Add a candidate edge for MIIC using engine names (e.g. "X[1]", "C").

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ addPossibleEdge() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::addPossibleEdge ( std::string_view tailBase,
int tailSlice,
std::string_view headBase,
int headSlice )
pure virtual

Add a candidate edge for MIIC (only edges explicitly listed are explored).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ allowArcAdditions()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::allowArcAdditions ( bool allow = true)
pure virtual

Allow or forbid arc additions during structure search.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ allowArcDeletions()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::allowArcDeletions ( bool allow = true)
pure virtual

Allow or forbid arc deletions during structure search.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ allowArcReversals()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::allowArcReversals ( bool allow = true)
pure virtual

Allow or forbid arc reversals during structure search.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ defaultPriorWeight_()

template<GUM_Numeric GUM_SCALAR>
double gum::learning::IKTBNLearner< GUM_SCALAR >::defaultPriorWeight_ ( )
staticprotected
Returns
the key priorWeight, read when it is called

Definition at line 68 of file IKTBNLearner_tpl.h.

68 {
69 return gum::config().typed< double >("learning", "priorWeight");
70 }
T typed(std::string_view section, std::string_view key) const
Value of section.key converted according to its declared type.
Configuration & config()
A short name for Configuration::instance() : gum::config().epsilonStandard(). It is not inline so tha...

References gum::config(), and gum::Configuration::typed().

Referenced by setMaxIndegree(), useSmoothingPrior(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::useSmoothingPrior(), and gum::learning::KTBNLearner< GUM_SCALAR >::useSmoothingPrior().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ defaultTabuListSize_()

template<GUM_Numeric GUM_SCALAR>
Size gum::learning::IKTBNLearner< GUM_SCALAR >::defaultTabuListSize_ ( )
staticprotected
Returns
the key tabuListSize, read when it is called

Definition at line 58 of file IKTBNLearner_tpl.h.

58 {
59 return static_cast< Size >(gum::config().typed< std::int64_t >("learning", "tabuListSize"));
60 }

References gum::config(), and gum::Configuration::typed().

Referenced by setMaxIndegree(), useLocalSearchWithTabuList(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::useLocalSearchWithTabuList(), and gum::learning::KTBNLearner< GUM_SCALAR >::useLocalSearchWithTabuList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ defaultTabuNbDecrease_()

template<GUM_Numeric GUM_SCALAR>
Size gum::learning::IKTBNLearner< GUM_SCALAR >::defaultTabuNbDecrease_ ( )
staticprotected
Returns
the key tabuNbDecrease, read when it is called

Definition at line 63 of file IKTBNLearner_tpl.h.

63 {
64 return static_cast< Size >(gum::config().typed< std::int64_t >("learning", "tabuNbDecrease"));
65 }

References gum::config(), and gum::Configuration::typed().

Referenced by setMaxIndegree(), useLocalSearchWithTabuList(), useLocalSearchWithTabuList(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::useLocalSearchWithTabuList(), gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >::useLocalSearchWithTabuList(), gum::learning::KTBNLearner< GUM_SCALAR >::useLocalSearchWithTabuList(), and gum::learning::KTBNLearner< GUM_SCALAR >::useLocalSearchWithTabuList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eraseForbiddenArc() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseForbiddenArc ( std::string_view tailBase,
int tailSlice,
std::string_view headBase,
int headSlice )
pure virtual

Undo a previous addForbiddenArc for a specific (base, slice) pair.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseForbiddenArc() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseForbiddenArc ( std::string_view tailNode,
std::string_view headNode )
pure virtual

Undo a previous addForbiddenArc (engine names).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseForbiddenArcAllSlices()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseForbiddenArcAllSlices ( std::string_view tailBase,
std::string_view headBase )
pure virtual

Undo a previous addForbiddenArcAllSlices.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseForbiddenIntraSliceArc()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseForbiddenIntraSliceArc ( std::string_view tailBase,
std::string_view headBase )
pure virtual

Undo a previous addForbiddenIntraSliceArc.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseMandatoryArc() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseMandatoryArc ( std::string_view tailBase,
int tailSlice,
std::string_view headBase,
int headSlice )
pure virtual

◆ eraseMandatoryArc() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseMandatoryArc ( std::string_view tailNode,
std::string_view headNode )
pure virtual

Undo a previous addMandatoryArc (engine names).

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseNoChildrenNode() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseNoChildrenNode ( std::string_view base,
int slice )
pure virtual

Undo a previous addNoChildrenNode for a single (base, slice) node.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseNoChildrenNode() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseNoChildrenNode ( std::string_view name)
pure virtual

Undo addNoChildrenNode for a node given by bracket notation.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseNoParentNode() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseNoParentNode ( std::string_view base,
int slice )
pure virtual

Undo a previous addNoParentNode for a single (base, slice) node.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ eraseNoParentNode() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::eraseNoParentNode ( std::string_view name)
pure virtual

Undo addNoParentNode for a node given by bracket notation.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ erasePossibleEdge() [1/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::erasePossibleEdge ( std::string_view tail,
std::string_view head )
pure virtual

Undo a previous addPossibleEdge using engine names (e.g. "X[1]", "C").

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ erasePossibleEdge() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::erasePossibleEdge ( std::string_view tailBase,
int tailSlice,
std::string_view headBase,
int headSlice )
pure virtual

◆ learnKTBN()

template<GUM_Numeric GUM_SCALAR>
virtual KTBN< GUM_SCALAR > gum::learning::IKTBNLearner< GUM_SCALAR >::learnKTBN ( )
pure virtual

Learn a k-TBN (structure + CPTs) with the recorded configuration. The fixed-k learner learns for its single k; the adaptive learner also selects the best k in [2, kMax].

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ setMaxIndegree()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::setMaxIndegree ( Size max_indegree)
pure virtual

Cap the number of parents of any single node.

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

References defaultPriorWeight_(), defaultTabuListSize_(), and defaultTabuNbDecrease_().

Here is the call graph for this function:

◆ useExtendedGreedyHillClimbing()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useExtendedGreedyHillClimbing ( )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ useFCI()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useFCI ( )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ useGreedyHillClimbing()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useGreedyHillClimbing ( )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ useGreedyThickThinning()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useGreedyThickThinning ( )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ useLocalSearchWithTabuList() [1/3]

template<GUM_Numeric GUM_SCALAR>
IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useLocalSearchWithTabuList ( )

local search with tabu list and the default parameters (keys tabuListSize and tabuNbDecrease of the section learning of gum::Configuration)

Definition at line 79 of file IKTBNLearner_tpl.h.

79 {
81 }
virtual IKTBNLearner< GUM_SCALAR > & useLocalSearchWithTabuList(Size tabu_size, Size nb_decrease)=0
local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the...

References defaultTabuListSize_(), defaultTabuNbDecrease_(), and useLocalSearchWithTabuList().

Here is the call graph for this function:

◆ useLocalSearchWithTabuList() [2/3]

template<GUM_Numeric GUM_SCALAR>
IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useLocalSearchWithTabuList ( Size tabu_size)

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Definition at line 74 of file IKTBNLearner_tpl.h.

References defaultTabuNbDecrease_(), and useLocalSearchWithTabuList().

Here is the call graph for this function:

◆ useLocalSearchWithTabuList() [3/3]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useLocalSearchWithTabuList ( Size tabu_size,
Size nb_decrease )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

References useLocalSearchWithTabuList().

Referenced by useLocalSearchWithTabuList(), useLocalSearchWithTabuList(), and useLocalSearchWithTabuList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ useMDLCorrection()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useMDLCorrection ( )
pure virtual

◆ useMIIC()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useMIIC ( )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ useNMLCorrection()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useNMLCorrection ( )
pure virtual

◆ useNoCorrection()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useNoCorrection ( )
pure virtual

◆ usePC()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::usePC ( )
pure virtual

local search with tabu list, with the default number of decreasing changes (key tabuNbDecrease of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

◆ useScoreAIC()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useScoreAIC ( )
pure virtual

◆ useScoreBD()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useScoreBD ( )
pure virtual

◆ useScoreBDeu()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useScoreBDeu ( )
pure virtual

◆ useScoreBIC()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useScoreBIC ( )
pure virtual

◆ useScorefNML()

template<GUM_Numeric GUM_SCALAR>
virtual void gum::learning::IKTBNLearner< GUM_SCALAR >::useScorefNML ( )
pure virtual

◆ useScoreLog2Likelihood()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useScoreLog2Likelihood ( )
pure virtual

◆ useScoreMDL()

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useScoreMDL ( )
pure virtual

◆ useSmoothingPrior() [1/2]

template<GUM_Numeric GUM_SCALAR>
IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useSmoothingPrior ( )

smoothing prior with the default weight (key priorWeight of the section learning of gum::Configuration)

Definition at line 84 of file IKTBNLearner_tpl.h.

84 {
86 }
virtual IKTBNLearner< GUM_SCALAR > & useSmoothingPrior(double weight)=0
smoothing prior with the default weight (key priorWeight of the section learning of gum::Configuratio...
static double defaultPriorWeight_()

References defaultPriorWeight_(), and useSmoothingPrior().

Here is the call graph for this function:

◆ useSmoothingPrior() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual IKTBNLearner< GUM_SCALAR > & gum::learning::IKTBNLearner< GUM_SCALAR >::useSmoothingPrior ( double weight)
pure virtual

smoothing prior with the default weight (key priorWeight of the section learning of gum::Configuration)

Implemented in gum::learning::KTBNAdaptiveLearner< GUM_SCALAR >, and gum::learning::KTBNLearner< GUM_SCALAR >.

References useSmoothingPrior().

Referenced by useSmoothingPrior(), and useSmoothingPrior().

Here is the call graph for this function:
Here is the caller graph for this function:

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