aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
gum::StructuralMetrics Class Reference

A class for comparing graphs based on their structures. More...

#include <structuralMetrics.h>

Collaboration diagram for gum::StructuralMetrics:

Public Member Functions

Constructors / Destructors
 StructuralMetrics ()
 default constructor
 ~StructuralMetrics ()
 destructor

Accessors

double _true_edge_
 Confusion matrix.
double _true_arc_
 Confusion matrix.
double _true_none_
 Confusion matrix.
double _wrong_edge_arc_
 Confusion matrix.
double _wrong_edge_none_
 Confusion matrix.
double _wrong_arc_edge_
 Confusion matrix.
double _wrong_arc_none_
 Confusion matrix.
double _misoriented_arc_
 Confusion matrix.
double _wrong_none_edge_
 Confusion matrix.
double _wrong_none_arc_
 Confusion matrix.
Size _size_
 Number of nodes in the compared graphs (set by compare()).
void compare (const DiGraph &ref, const DiGraph &test)
 compare two DiGraphs (nodes matched by NodeId, no alignment)
void compare (const UndiGraph &ref, const UndiGraph &test)
 compare two UndiGraphs (nodes matched by NodeId, no alignment)
void compare (const PDAG &ref, const PDAG &test)
 compare two PDAGs (nodes matched by NodeId, no alignment)
template<typename GS1, typename GS2>
void compare (const BayesNet< GS1 > &ref, const BayesNet< GS2 > &test)
 compare two BNs via their essential graphs (nodes matched by variable name). For a DAG-level BN comparison, align NodeIds manually and use compare(DiGraph, DiGraph) with bn.dag().
template<GUM_Numeric GUM_SCALAR>
void compare (const BayesNet< GUM_SCALAR > &ref, const PDAG &test)
 compare a PDAG with the essential graph of a reference BN (nodes matched by NodeId, no name-based alignment)
template<GUM_Numeric GUM_SCALAR>
void compare (const PDAG &ref, const BayesNet< GUM_SCALAR > &test)
 compare the essential graph of a BN with a reference PDAG (nodes matched by NodeId, no name-based alignment)
double tp_skeleton () const
 Measures for the skeleton, aka graph without orientations.
double fp_skeleton () const
 Confusion matrix.
double fn_skeleton () const
 Confusion matrix.
double tn_skeleton () const
 Confusion matrix.
double precision_skeleton () const
 Confusion matrix.
double recall_skeleton () const
 Confusion matrix.
double f_score_skeleton () const
 Confusion matrix.
double shd_skeleton () const
 Confusion matrix.
double tp () const
 Measures for the graphs.
double fp () const
 Confusion matrix.
double fn () const
 Confusion matrix.
double tn () const
 Confusion matrix.
double precision () const
 Confusion matrix.
double recall () const
 Confusion matrix.
double f_score () const
 Confusion matrix.
double shd () const
 Confusion matrix.
double sid (const DAG &ref, const DAG &test) const
 Confusion matrix.
template<typename GS1, typename GS2>
double sid (const BayesNet< GS1 > &ref, const BayesNet< GS2 > &test) const
 SID overload comparing the DAGs of two BNs (NOT their essential graphs).

Detailed Description

A class for comparing graphs based on their structures.

Definition at line 63 of file structuralMetrics.h.

Constructor & Destructor Documentation

◆ StructuralMetrics()

gum::StructuralMetrics::StructuralMetrics ( )

default constructor

◆ ~StructuralMetrics()

gum::StructuralMetrics::~StructuralMetrics ( )

destructor

Member Function Documentation

◆ compare() [1/6]

template<typename GS1, typename GS2>
void gum::StructuralMetrics::compare ( const BayesNet< GS1 > & ref,
const BayesNet< GS2 > & test )

compare two BNs via their essential graphs (nodes matched by variable name). For a DAG-level BN comparison, align NodeIds manually and use compare(DiGraph, DiGraph) with bn.dag().

◆ compare() [2/6]

template<GUM_Numeric GUM_SCALAR>
void gum::StructuralMetrics::compare ( const BayesNet< GUM_SCALAR > & ref,
const PDAG & test )

compare a PDAG with the essential graph of a reference BN (nodes matched by NodeId, no name-based alignment)

◆ compare() [3/6]

void gum::StructuralMetrics::compare ( const DiGraph & ref,
const DiGraph & test )

compare two DiGraphs (nodes matched by NodeId, no alignment)

◆ compare() [4/6]

template<GUM_Numeric GUM_SCALAR>
void gum::StructuralMetrics::compare ( const PDAG & ref,
const BayesNet< GUM_SCALAR > & test )

compare the essential graph of a BN with a reference PDAG (nodes matched by NodeId, no name-based alignment)

◆ compare() [5/6]

void gum::StructuralMetrics::compare ( const PDAG & ref,
const PDAG & test )

compare two PDAGs (nodes matched by NodeId, no alignment)

◆ compare() [6/6]

void gum::StructuralMetrics::compare ( const UndiGraph & ref,
const UndiGraph & test )

compare two UndiGraphs (nodes matched by NodeId, no alignment)

◆ f_score()

double gum::StructuralMetrics::f_score ( ) const

Confusion matrix.

◆ f_score_skeleton()

double gum::StructuralMetrics::f_score_skeleton ( ) const

Confusion matrix.

◆ fn()

double gum::StructuralMetrics::fn ( ) const

Confusion matrix.

◆ fn_skeleton()

double gum::StructuralMetrics::fn_skeleton ( ) const

Confusion matrix.

◆ fp()

double gum::StructuralMetrics::fp ( ) const

Confusion matrix.

◆ fp_skeleton()

double gum::StructuralMetrics::fp_skeleton ( ) const

Confusion matrix.

◆ precision()

double gum::StructuralMetrics::precision ( ) const

Confusion matrix.

◆ precision_skeleton()

double gum::StructuralMetrics::precision_skeleton ( ) const

Confusion matrix.

◆ recall()

double gum::StructuralMetrics::recall ( ) const

Confusion matrix.

◆ recall_skeleton()

double gum::StructuralMetrics::recall_skeleton ( ) const

Confusion matrix.

◆ shd()

double gum::StructuralMetrics::shd ( ) const

Confusion matrix.

◆ shd_skeleton()

double gum::StructuralMetrics::shd_skeleton ( ) const

Confusion matrix.

◆ sid() [1/2]

template<typename GS1, typename GS2>
double gum::StructuralMetrics::sid ( const BayesNet< GS1 > & ref,
const BayesNet< GS2 > & test ) const

SID overload comparing the DAGs of two BNs (NOT their essential graphs).

◆ sid() [2/2]

double gum::StructuralMetrics::sid ( const DAG & ref,
const DAG & test ) const

Confusion matrix.

◆ tn()

double gum::StructuralMetrics::tn ( ) const

Confusion matrix.

◆ tn_skeleton()

double gum::StructuralMetrics::tn_skeleton ( ) const

Confusion matrix.

◆ tp()

double gum::StructuralMetrics::tp ( ) const

Measures for the graphs.

◆ tp_skeleton()

double gum::StructuralMetrics::tp_skeleton ( ) const

Measures for the skeleton, aka graph without orientations.

Member Data Documentation

◆ _misoriented_arc_

double gum::StructuralMetrics::_misoriented_arc_
private

Confusion matrix.

Definition at line 147 of file structuralMetrics.h.

◆ _size_

Size gum::StructuralMetrics::_size_
private

Number of nodes in the compared graphs (set by compare()).

Definition at line 152 of file structuralMetrics.h.

◆ _true_arc_

double gum::StructuralMetrics::_true_arc_
private

Confusion matrix.

Definition at line 145 of file structuralMetrics.h.

◆ _true_edge_

double gum::StructuralMetrics::_true_edge_
private

Confusion matrix.

Definition at line 145 of file structuralMetrics.h.

◆ _true_none_

double gum::StructuralMetrics::_true_none_
private

Confusion matrix.

Definition at line 145 of file structuralMetrics.h.

◆ _wrong_arc_edge_

double gum::StructuralMetrics::_wrong_arc_edge_
private

Confusion matrix.

Definition at line 147 of file structuralMetrics.h.

◆ _wrong_arc_none_

double gum::StructuralMetrics::_wrong_arc_none_
private

Confusion matrix.

Definition at line 147 of file structuralMetrics.h.

◆ _wrong_edge_arc_

double gum::StructuralMetrics::_wrong_edge_arc_
private

Confusion matrix.

Definition at line 146 of file structuralMetrics.h.

◆ _wrong_edge_none_

double gum::StructuralMetrics::_wrong_edge_none_
private

Confusion matrix.

Definition at line 146 of file structuralMetrics.h.

◆ _wrong_none_arc_

double gum::StructuralMetrics::_wrong_none_arc_
private

Confusion matrix.

Definition at line 148 of file structuralMetrics.h.

◆ _wrong_none_edge_

double gum::StructuralMetrics::_wrong_none_edge_
private

Confusion matrix.

Definition at line 148 of file structuralMetrics.h.


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