[aGrUM/pyAgrum] minor cosmetics change

parent a715d364
......@@ -70,8 +70,8 @@ namespace gum {
* Copy Operator
*/
template < typename GUM_SCALAR >
InfluenceDiagram< GUM_SCALAR >& InfluenceDiagram< GUM_SCALAR >::
operator=(const InfluenceDiagram< GUM_SCALAR >& source) {
InfluenceDiagram< GUM_SCALAR >& InfluenceDiagram< GUM_SCALAR >::operator=(
const InfluenceDiagram< GUM_SCALAR >& source) {
if (this != &source) {
DAGmodel::operator=(source);
// Removing previous potentials
......@@ -199,8 +199,7 @@ namespace gum {
for (const auto chi : _dag.children(node))
arcstream << tab << "\"" << variable(node).name() << "\""
<< " -> "
<< "\"" << variable(chi).name() << "\""
<< ";" << std::endl;
<< "\"" << variable(chi).name() << "\";" << std::endl;
}
output << decisionNode.str() << std::endl
......
......@@ -36,18 +36,13 @@
namespace gum {
/* ===========================================================================
*/
/* ===========================================================================
*/
/* === IMPLEMENTATION OF GUM_CLIQUE_GRAPH ===
*/
/* ===========================================================================
*/
/* ===========================================================================
*/
/// basic constructor: creates an empty xsclique graph
/* =================================================================== */
/* =================================================================== */
/* === IMPLEMENTATION OF GUM_CLIQUE_GRAPH === */
/* =================================================================== */
/* =================================================================== */
/// basic constructor: creates an empty clique graph
CliqueGraph::CliqueGraph(Size nodes_size,
bool nodes_resize_policy,
......@@ -314,12 +309,13 @@ namespace gum {
const std::string CliqueGraph::toDot() const {
std::stringstream stream;
stream << "graph {" << std::endl;
stream << " node [style=\"filled\", fontcolor=\"black\"];" << std::endl;
// cliques as nodes
for (auto node : nodes()) {
std::string nom = '"' + expandClique(node, clique(node)) + '"';
stream << " " << nom << " [label=\"" << expandCliqueContent(clique(node))
<< "\",fillcolor =\"burlywood\",style=\"filled\"];" << std::endl;
<< "\",fillcolor =\"burlywood\"];" << std::endl;
}
stream << std::endl;
......@@ -332,7 +328,7 @@ namespace gum {
edge.second(),
clique(edge.second()))
<< "\" [label=\"" << expandCliqueContent(separator(edge)) << "\""
<< ",shape=box,fillcolor=\"palegreen\",style=\"filled\",fontsize=8,"
<< ",shape=box,fillcolor=\"palegreen\",fontsize=8,"
"width=0,height=0];"
<< std::endl;
}
......
......@@ -958,6 +958,8 @@ def getInferenceEngine(ie, inferenceCaption):
# adding _repr_html_ to some pyAgrum classes !
gum.BayesNet._repr_html_ = lambda self: getBN(self)
gum.BayesNetFragment._repr_html_ = lambda self: getBN(self)
gum.Potential._repr_html_ = lambda self: getPotential(self)
gum.LazyPropagation._repr_html_ = lambda self: getInferenceEngine(
self, "Lazy Propagation on this BN")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -399,7 +399,7 @@
"<polygon fill=\"#000000\" points=\"42.9775,-46.4132 39.4774,-36.4133 35.9775,-46.4133 42.9775,-46.4132\" stroke=\"#000000\"/>\n",
"</g>\n",
"</g>\n",
"</svg></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>count </b>:{'tp': 4, 'tn': 22, 'fp': 2, 'fn': 2}<br/><b>recall </b>:0.6666666666666666<br/><b>precision </b>:0.6666666666666666<br/><b>fscore </b>:0.6666666666666666<br/><b>dist2opt </b>:0.47140452079103173<br/><br/><b>hamming </b>:2<br/><b>structural hamming</b>:4</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\">B has different parents in the two bns whose names are in {'C'}</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>klPQ </b>:1.4401625160438096<br/><b>errorPQ </b>:0<br/><b>klQP </b>:3.4327096002076365<br/><b>errorQP </b>:0<br/><b>hellinger </b>:0.7662929703758177<br/><b>bhattacharya </b>:0.3475771096300624<br/><b>jensen-shannon </b>:0.35894932256790907</div></td></tr><tr><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn1</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn2</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>graphical diff</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>Scores</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>equivalent ?</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>distances</small></div></td></tr></table>"
"</svg></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>count </b>:{'tp': 4, 'tn': 22, 'fp': 2, 'fn': 2}<br/><b>recall </b>:0.6666666666666666<br/><b>precision </b>:0.6666666666666666<br/><b>fscore </b>:0.6666666666666666<br/><b>dist2opt </b>:0.47140452079103173<br/><br/><b>hamming </b>:2<br/><b>structural hamming</b>:4</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\">B has different parents in the two bns whose names are in {'C'}</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>klPQ </b>:3.4256934591002244<br/><b>errorPQ </b>:0<br/><b>klQP </b>:4.280798777973704<br/><b>errorQP </b>:0<br/><b>hellinger </b>:0.9949138002593297<br/><b>bhattacharya </b>:0.6830517809688268<br/><b>jensen-shannon </b>:0.5969293476303733</div></td></tr><tr><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn1</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn2</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>graphical diff</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>Scores</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>equivalent ?</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>distances</small></div></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
......@@ -452,7 +452,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2019-02-25T16:05:22.352141Z",
......@@ -781,7 +781,7 @@
"<polygon fill=\"#000000\" points=\"47.1685,-46.1853 47.4026,-35.593 40.6142,-43.7274 47.1685,-46.1853\" stroke=\"#000000\"/>\n",
"</g>\n",
"</g>\n",
"</svg></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>count </b>:{'tp': 6, 'tn': 24, 'fp': 0, 'fn': 0}<br/><b>recall </b>:1.0<br/><b>precision </b>:1.0<br/><b>fscore </b>:1.0<br/><b>dist2opt </b>:0.0<br/><br/><b>hamming </b>:0<br/><b>structural hamming</b>:0</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\">Different CPTs for A</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>klPQ </b>:2.7237351448161076<br/><b>errorPQ </b>:0<br/><b>klQP </b>:3.692600920437989<br/><b>errorQP </b>:0<br/><b>hellinger </b>:0.923202087269374<br/><b>bhattacharya </b>:0.5553890653221658<br/><b>jensen-shannon </b>:0.51691153193475</div></td></tr><tr><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn1</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn2</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>graphical diff</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>Scores</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>equivalent ?</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>distances</small></div></td></tr></table>"
"</svg></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>count </b>:{'tp': 6, 'tn': 24, 'fp': 0, 'fn': 0}<br/><b>recall </b>:1.0<br/><b>precision </b>:1.0<br/><b>fscore </b>:1.0<br/><b>dist2opt </b>:0.0<br/><br/><b>hamming </b>:0<br/><b>structural hamming</b>:0</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\">Different CPTs for A</div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\" style=\"\"><b>klPQ </b>:4.982470589220756<br/><b>errorPQ </b>:0<br/><b>klQP </b>:6.46318241487143<br/><b>errorQP </b>:0<br/><b>hellinger </b>:1.1664417350478242<br/><b>bhattacharya </b>:1.1403508300600567<br/><b>jensen-shannon </b>:0.781625082460194</div></td></tr><tr><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn1</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>bn2</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>graphical diff</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>Scores</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>equivalent ?</small></div></td><td style=\"border-top:hidden;border-bottom:hidden;\"><div align=\"center\"><small>distances</small></div></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
......@@ -809,7 +809,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"metadata": {
"ExecuteTime": {
"end_time": "2019-02-25T16:05:28.885297Z",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment