aGrUM  0.16.0
structuralComparator.h
Go to the documentation of this file.
1 
31 #ifndef GUM_LEARNING_STRUCTURAL_COMPARATOR_H
32 #define GUM_LEARNING_STRUCTURAL_COMPARATOR_H
33 
34 #include <agrum/BN/BayesNet.h>
35 #include <agrum/graphs/diGraph.h>
37 #include <agrum/graphs/undiGraph.h>
38 
39 
40 namespace gum {
41 
48  public:
49  // ##########################################################################
51  // ##########################################################################
53 
56 
59 
61 
62  // ##########################################################################
64  // ##########################################################################
67  void compare(const DiGraph& ref, const DiGraph& test);
69  void compare(const UndiGraph& ref, const UndiGraph& test);
71  void compare(const MixedGraph& ref, const MixedGraph& test);
73  template < typename GS1, typename GS2 >
74  void compare(const BayesNet< GS1 >& ref, const BayesNet< GS2 >& test);
76  template < typename GUM_SCALAR >
77  void compare(const BayesNet< GUM_SCALAR >& ref, const MixedGraph& test);
79  template < typename GUM_SCALAR >
80  void compare(const MixedGraph& ref, const BayesNet< GUM_SCALAR >& test);
81 
83  double precision_skeleton() const;
84  double recall_skeleton() const;
85  double f_score_skeleton() const;
86 
88  double precision() const;
89  double recall() const;
90  double f_score() const;
92 
93  protected:
94  private:
96  /* __________________________________________________
97  * | \predicted | | | |
98  * |true\ | --> | --- | X |
99  * |--------------|-----------|-----------|-----------|
100  * | --> | true arc |wrong edge |wrong none |
101  * | | mis. arc | arc | arc |
102  * |--------------|-----------|-----------|-----------|
103  * | --- |wrong arc | true edge |wrong none |
104  * | | edge | | edge |
105  * |--------------|-----------|-----------|-----------|
106  * | X |wrong arc |wrong edge | true none |
107  * | | none | none | |
108  * |______________|___________|___________|___________|
109  *
110  */
115  // double __precision, __recall, __f_score;
116  };
117 
118 } /* namespace gum */
119 
122 
123 #endif /* GUM_LEARNING_STRUCTURAL_COMPARATOR_H */
double f_score_skeleton() const
compare two DiGraphs
Class representing a Bayesian Network.
Definition: BayesNet.h:78
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double recall_skeleton() const
compare two DiGraphs
double f_score() const
compare two DiGraphs
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
double precision() const
Measures for the graphs.
double recall() const
compare two DiGraphs
A class for comparing graphs based on their structures.
Base class for all oriented graphs.
Definition: diGraph.h:111
StructuralComparator()
default constructor
void compare(const DiGraph &ref, const DiGraph &test)
compare two DiGraphs
double __true_edge
Confusion matrix.
double precision_skeleton() const
Measures for the skeleton, aka graph without orientations.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Base class for undirected graphs.
Definition: undiGraph.h:109
~StructuralComparator()
destructor
Base class for mixed graphs.
Definition: mixedGraph.h:127