53#ifndef GUM_CONSTRAINT_BASED_LEARNING_H
54#define GUM_CONSTRAINT_BASED_LEARNING_H
61#include <agrum/config.h>
66#define GUM_SL_EMIT(x, y, action, explain) \
68 std::ostringstream action_stream; \
69 action_stream << action; \
70 std::ostringstream explain_stream; \
71 explain_stream << explain; \
72 GUM_EMIT4(onStructuralModification, x, y, action_stream.str(), explain_stream.str()); \
140 template < GUM_Numeric GUM_SCALAR =
double,
typename PARAM_ESTIMATOR >
Meek rules for orienting edges in a mixed graph.
This file contains general scheme for iteratively convergent algorithms.
ApproximationScheme(bool verbosity=false)
Base class for all oriented graphs.
The class for generic Hash Tables.
Applies Meek's orientation rules to propagate arc directions in a mixed graph.
Base class for mixed graphs.
Base class for partially directed acyclic graphs.
gum::DAG _mandatoryGraph_
virtual MixedGraph learnSkeleton(MixedGraph graph)=0
Signaler< gum::NodeId, gum::NodeId, std::string, std::string > onStructuralModification
gum::DiGraph _forbiddenGraph_
void setMandatoryGraph(const gum::DAG &mandaGraph)
std::vector< ThreePoints > unshieldedTriples_(const MixedGraph &graph)
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
static bool _existsNonTrivialDirectedPath_(const MixedGraph &graph, NodeId n1, NodeId n2)
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
gum::MeekRules meekRules_
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
bool isForbiddenEdge_(NodeId x, NodeId y) const
bool isMaxIndegree_(const MixedGraph &graph, NodeId x)
bool isForbiddenArc_(NodeId x, NodeId y) const
void setMaxIndegree(gum::Size n)
void setForbiddenGraph(const gum::DiGraph &forbidGraph)
const std::vector< Arc > latentVariables() const
const std::vector< NodeId > _emptySet_
bool isArcValid_(const MixedGraph &graph, NodeId x, NodeId y)
void orientDoubleHeadedArcs_(MixedGraph &mg)
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
PDAG learnPDAG(MixedGraph graph)
learns the essential graph (CPDAG)
HashTable< std::pair< NodeId, NodeId >, char > _initialMarks_
static bool _existsDirectedPath_(const MixedGraph &graph, NodeId n1, NodeId n2)
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
ConstraintBasedLearning()
BayesNet< GUM_SCALAR > learnBN(PARAM_ESTIMATOR &estimator, MixedGraph graph)
learns structure then estimates parameters
void addConstraints(const HashTable< std::pair< NodeId, NodeId >, char > &constraints)
virtual MixedGraph learnMixedStructure(MixedGraph graph)=0
ConstraintBasedLearning & operator=(const ConstraintBasedLearning &)
~ConstraintBasedLearning() override
DAG learnDAG(MixedGraph graph)
learns a DAG
void applyStructuralConstraints_(MixedGraph &graph)
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
MixedGraph initGraph_(const MixedGraph &template_graph)
Builds a complete MixedGraph on the nodes of template_graph, minus edges forbidden by structural cons...
std::vector< Arc > _latentCouples_
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
std::tuple< NodeId, NodeId, NodeId > ThreePoints
gum is the global namespace for all aGrUM entities