1
0
Fork 0
Old engine for Continuous Time Bayesian Networks. Superseded by reCTBN. 🐍 https://github.com/madlabunimib/PyCTBN
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
PyCTBN/docs/PyCTBN.PyCTBN.structure_gra...

941 lines
76 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="" lang="" version="-//W3C//DTD XHTML 1.1//EN" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PyCTBN.PyCTBN.structure_graph package &mdash; PyCTBN 2.0 documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'/>
<link rel="stylesheet" href="_static/css/pdj.css" type="text/css" />
3 years ago
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/pdj.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="PyCTBN 2.0 documentation" href="index.html"/>
<link rel="up" title="PyCTBN.PyCTBN package" href="PyCTBN.PyCTBN.html"/>
<link rel="next" title="PyCTBN.PyCTBN.utility package" href="PyCTBN.PyCTBN.utility.html"/>
<link rel="prev" title="PyCTBN.PyCTBN.optimizers package" href="PyCTBN.PyCTBN.optimizers.html"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="public" />
<meta name="robots" content="follow, all" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Add jQuery library -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="fa fa-home"> PyCTBN </a>
<div role="search">
<form id ="rtd-search-form" class="wy-form"
action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="PyCTBN.PyCTBN.html">PyCTBN.PyCTBN package</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="PyCTBN.PyCTBN.html#subpackages">Subpackages</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.PyCTBN.html#module-PyCTBN.PyCTBN">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples.html#installation-usage">Installation/Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#implementing-your-own-data-importer">Implementing your own data importer</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#parameters-estimation-example">Parameters Estimation Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#structure-estimation-example">Structure Estimation Example</a></li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" id="barra-mobile" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">Porão do Juca</a>
</nav>
<div class="wy-nav-content">
<div class="fundo-claro">
</div>
<div class="fundo-escuro">
</div>
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<!-- <ul class="wy-breadcrumbs"> -->
<!-- <li><a href="#">Docs</a> &raquo;</li> -->
<!-- <li>Features</li> -->
<!-- <li class="wy-breadcrumbs-aside"> -->
<!-- <a href="_sources/index.txt" rel="nofollow"> View page source</a> -->
<!-- </li> -->
<!-- </ul> -->
<!-- <hr/> -->
</div>
<div role="main" class="">
<div id="content" class="hfeed entry-container hentry">
<section id="pyctbn-pyctbn-structure-graph-package">
<h1>PyCTBN.PyCTBN.structure_graph package<a class="headerlink" href="#pyctbn-pyctbn-structure-graph-package" title="Permalink to this headline"></a></h1>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix">
<span id="pyctbn-pyctbn-structure-graph-conditional-intensity-matrix-module"></span><h2>PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix" title="Permalink to this headline"></a></h2>
<dl class="py class">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.</span></span><span class="sig-name descname"><span class="pre">ConditionalIntensityMatrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">state_residence_times</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">numpy.array</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">state_transition_matrix</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">numpy.array</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cim</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">numpy.array</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Abstracts the Conditional Intesity matrix of a node as aggregation of the state residence times vector
and state transition matrix and the actual CIM matrix.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>state_residence_times</strong> (<em>numpy.array</em>) – state residence times vector</p></li>
<li><p><strong>state_transition_matrix</strong> (<em>numpy.ndArray</em>) – the transitions count matrix</p></li>
</ul>
</dd>
<dt class="field-even">_cim</dt>
<dd class="field-even"><p>the actual cim of the node</p>
</dd>
</dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.cim">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">cim</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.cim" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.compute_cim_coefficients">
<span class="sig-name descname"><span class="pre">compute_cim_coefficients</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.compute_cim_coefficients" title="Permalink to this definition"></a></dt>
<dd><p>Compute the coefficients of the matrix _cim by using the following equality q_xx’ = M[x, x’] / T[x].
The class member <code class="docutils literal notranslate"><span class="pre">_cim</span></code> will contain the computed cim</p>
</dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.state_residence_times">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">state_residence_times</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.state_residence_times" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.state_transition_matrix">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">state_transition_matrix</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix.state_transition_matrix" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-PyCTBN.PyCTBN.structure_graph.network_generator">
<span id="pyctbn-pyctbn-structure-graph-network-generator-module"></span><h2>PyCTBN.PyCTBN.structure_graph.network_generator module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.network_generator" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.network_generator.</span></span><span class="sig-name descname"><span class="pre">NetworkGenerator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">labels</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Provides the methods to generate a network graph and the CIMs related to it
Items in _labels, _vals and _indxs are related, and therefore respect the same order</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>_labels</strong> (<em>List</em>) – List of variables labels that will be part of the network</p></li>
<li><p><strong>_vals</strong> (<em>List</em>) – List of cardinalities of the variables in network (defined in the same order as _labels)</p></li>
<li><p><strong>_indxs</strong> (<em>List</em>) – List of the nodes indexes</p></li>
<li><p><strong>_cims</strong> (<em>Dict</em>) – It contains, for each variable label (the key), the SetOfCims object related to it</p></li>
<li><p><strong>_graph</strong> (<a class="reference internal" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph" title="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph"><em>NetworkGraph</em></a>) – The NetworkGraph object representing the generated structure</p></li>
</ul>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.cims">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">cims</span></span><em class="property"><span class="pre">:</span> <span class="pre">dict</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.cims" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.dyn_str">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">dyn_str</span></span><em class="property"><span class="pre">:</span> <span class="pre">list</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.dyn_str" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.generate_cims">
<span class="sig-name descname"><span class="pre">generate_cims</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_val</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.generate_cims" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>For each node, generate the corresponding SetOfCims. The objective is to group the CIMs </dt><dd><p>(actually generated by private method __generate_cim) according to parents possibles states of every node.
This method must obviously be executed after the graph has been generated.</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>min_val</strong> (<em>float</em>) – Minimum value allowed for the coefficients in the CIMs</p></li>
<li><p><strong>max_val</strong> (<em>float</em>) – Maximum value allowed for the coefficients in the CIMs</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.generate_graph">
<span class="sig-name descname"><span class="pre">generate_graph</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">density</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fixed</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">bool</span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.generate_graph" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>Generate the edges according to specified density, and then instantiate the NetworkGraph object</dt><dd><p>to represent the network</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>density</strong> (<em>float</em>) – Probability of an edge between two nodes to exist</p></li>
<li><p><strong>fixed</strong> (<em>bool</em>) – Specifies whether the required density is mandatory or it’s just a probability</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.graph">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">graph</span></span><em class="property"><span class="pre">:</span> <span class="pre">PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.graph" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.variables">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">variables</span></span><em class="property"><span class="pre">:</span> <span class="pre">list</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator.variables" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph.network_graph">
<span id="pyctbn-pyctbn-structure-graph-network-graph-module"></span><h2>PyCTBN.PyCTBN.structure_graph.network_graph module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.network_graph" title="Permalink to this headline"></a></h2>
<dl class="py class">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.network_graph.</span></span><span class="sig-name descname"><span class="pre">NetworkGraph</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">graph_struct</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure" title="PyCTBN.PyCTBN.structure_graph.structure.Structure"><span class="pre">PyCTBN.PyCTBN.structure_graph.structure.Structure</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Abstracts the infos contained in the Structure class in the form of a directed graph.
Has the task of creating all the necessary filtering and indexing structures for parameters estimation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>graph_struct</strong> (<a class="reference internal" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure" title="PyCTBN.PyCTBN.structure_graph.structure.Structure"><em>Structure</em></a>) – the <code class="docutils literal notranslate"><span class="pre">Structure</span></code> object from which infos about the net will be extracted</p>
</dd>
<dt class="field-even">_graph</dt>
<dd class="field-even"><p>directed graph</p>
</dd>
<dt class="field-odd">_aggregated_info_about_nodes_parents</dt>
<dd class="field-odd"><p>a structure that contains all the necessary infos
about every parents of the node of which all the indexing and filtering structures will be constructed.</p>
</dd>
<dt class="field-even">_time_scalar_indexing_structure</dt>
<dd class="field-even"><p>the indexing structure for state res time estimation</p>
</dd>
<dt class="field-odd">_transition_scalar_indexing_structure</dt>
<dd class="field-odd"><p>the indexing structure for transition computation</p>
</dd>
<dt class="field-even">_time_filtering</dt>
<dd class="field-even"><p>the columns filtering structure used in the computation of the state res times</p>
</dd>
<dt class="field-odd">_transition_filtering</dt>
<dd class="field-odd"><p>the columns filtering structure used in the computation of the transition
from one state to another</p>
</dd>
<dt class="field-even">_p_combs_structure</dt>
<dd class="field-even"><p>all the possible parents states combination for the node of interest</p>
</dd>
</dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.add_edges">
<span class="sig-name descname"><span class="pre">add_edges</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">list_of_edges</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.add_edges" title="Permalink to this definition"></a></dt>
<dd><p>Add the edges to the <code class="docutils literal notranslate"><span class="pre">_graph</span></code> contained in the list <code class="docutils literal notranslate"><span class="pre">list_of_edges</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>list_of_edges</strong> (<em>List</em>) – the list containing of tuples containing the edges</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.add_nodes">
<span class="sig-name descname"><span class="pre">add_nodes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">list_of_nodes</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.add_nodes" title="Permalink to this definition"></a></dt>
<dd><p>Adds the nodes to the <code class="docutils literal notranslate"><span class="pre">_graph</span></code> contained in the list of nodes <code class="docutils literal notranslate"><span class="pre">list_of_nodes</span></code>.
Sets all the properties that identify a nodes (index, positional index, cardinality)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>list_of_nodes</strong> (<em>List</em>) – the nodes to add to <code class="docutils literal notranslate"><span class="pre">_graph</span></code></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_p_comb_structure_for_a_node">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">build_p_comb_structure_for_a_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parents_values</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">numpy.ndarray</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_p_comb_structure_for_a_node" title="Permalink to this definition"></a></dt>
<dd><p>Builds the combinatorial structure that contains the combinations of all the values contained in
<code class="docutils literal notranslate"><span class="pre">parents_values</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parents_values</strong> (<em>List</em>) – the cardinalities of the nodes</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A numpy matrix containing a grid of the combinations</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndArray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_time_columns_filtering_for_a_node">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">build_time_columns_filtering_for_a_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_indx</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p_indxs</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">numpy.ndarray</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_time_columns_filtering_for_a_node" title="Permalink to this definition"></a></dt>
<dd><p>Builds the necessary structure to filter the desired columns indicated by <code class="docutils literal notranslate"><span class="pre">node_indx</span></code> and <code class="docutils literal notranslate"><span class="pre">p_indxs</span></code>
in the dataset.
This structute will be used in the computation of the state res times.
:param node_indx: the index of the node
:type node_indx: int
:param p_indxs: the indexes of the node’s parents
:type p_indxs: List
:return: The filtering structure for times estimation
:rtype: numpy.ndArray</p>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_time_scalar_indexing_structure_for_a_node">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">build_time_scalar_indexing_structure_for_a_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_states</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parents_vals</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">numpy.ndarray</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_time_scalar_indexing_structure_for_a_node" title="Permalink to this definition"></a></dt>
<dd><p>Builds an indexing structure for the computation of state residence times values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>node_states</strong> (<em>int</em>) – the node cardinality</p></li>
<li><p><strong>parents_vals</strong> (<em>List</em>) – the caridinalites of the node’s parents</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The time indexing structure</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndArray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_transition_filtering_for_a_node">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">build_transition_filtering_for_a_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_indx</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p_indxs</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nodes_number</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">numpy.ndarray</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_transition_filtering_for_a_node" title="Permalink to this definition"></a></dt>
<dd><p>Builds the necessary structure to filter the desired columns indicated by <code class="docutils literal notranslate"><span class="pre">node_indx</span></code> and <code class="docutils literal notranslate"><span class="pre">p_indxs</span></code>
in the dataset.
This structure will be used in the computation of the state transitions values.
:param node_indx: the index of the node
:type node_indx: int
:param p_indxs: the indexes of the node’s parents
:type p_indxs: List
:param nodes_number: the total number of nodes in the dataset
:type nodes_number: int
:return: The filtering structure for transitions estimation
:rtype: numpy.ndArray</p>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_transition_scalar_indexing_structure_for_a_node">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">build_transition_scalar_indexing_structure_for_a_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_states_number</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parents_vals</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">numpy.ndarray</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.build_transition_scalar_indexing_structure_for_a_node" title="Permalink to this definition"></a></dt>
<dd><p>Builds an indexing structure for the computation of state transitions values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>node_states_number</strong> (<em>int</em>) – the node cardinality</p></li>
<li><p><strong>parents_vals</strong> (<em>List</em>) – the caridinalites of the node’s parents</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The transition indexing structure</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndArray</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.clear_indexing_filtering_structures">
<span class="sig-name descname"><span class="pre">clear_indexing_filtering_structures</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.clear_indexing_filtering_structures" title="Permalink to this definition"></a></dt>
<dd><p>Initialize all the filtering/indexing structures.</p>
</dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.edges">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">edges</span></span><em class="property"><span class="pre">:</span> <span class="pre">List</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.edges" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.fast_init">
<span class="sig-name descname"><span class="pre">fast_init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.fast_init" title="Permalink to this definition"></a></dt>
<dd><p>Initializes all the necessary structures for parameters estimation of the node identified by the label
node_id</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node_id</strong> (<em>string</em>) – the label of the node</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_node_indx">
<span class="sig-name descname"><span class="pre">get_node_indx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">int</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_node_indx" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_ordered_by_indx_set_of_parents">
<span class="sig-name descname"><span class="pre">get_ordered_by_indx_set_of_parents</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">Tuple</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_ordered_by_indx_set_of_parents" title="Permalink to this definition"></a></dt>
<dd><p>Builds the aggregated structure that holds all the infos relative to the parent set of the node, namely
(parents_labels, parents_indexes, parents_cardinalities).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node</strong> (<em>string</em>) – the label of the node</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a tuple containing all the parent set infos</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_parents_by_id">
<span class="sig-name descname"><span class="pre">get_parents_by_id</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">List</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_parents_by_id" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of labels of the parents of the node <code class="docutils literal notranslate"><span class="pre">node_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node_id</strong> (<em>string</em>) – the node label</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a List of labels of the parents</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>List</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_positional_node_indx">
<span class="sig-name descname"><span class="pre">get_positional_node_indx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">int</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_positional_node_indx" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_states_number">
<span class="sig-name descname"><span class="pre">get_states_number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">int</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.get_states_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.has_edge">
<span class="sig-name descname"><span class="pre">has_edge</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">edge</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">tuple</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">bool</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.has_edge" title="Permalink to this definition"></a></dt>
<dd><p>Check if the graph contains a specific edge</p>
<dl class="simple">
<dt>Parameters:</dt><dd><p>edge: a tuple that rappresents the edge</p>
</dd>
<dt>Returns:</dt><dd><p>bool</p>
</dd>
</dl>
</dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.nodes">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nodes</span></span><em class="property"><span class="pre">:</span> <span class="pre">List</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.nodes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.nodes_indexes">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nodes_indexes</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.nodes_indexes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.nodes_values">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nodes_values</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.nodes_values" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.p_combs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">p_combs</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.p_combs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.remove_edges">
<span class="sig-name descname"><span class="pre">remove_edges</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">list_of_edges</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.remove_edges" title="Permalink to this definition"></a></dt>
<dd><p>Remove the edges to the graph contained in the list list_of_edges.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>list_of_edges</strong> (<em>List</em>) – The edges to remove from the graph</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.remove_node">
<span class="sig-name descname"><span class="pre">remove_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.remove_node" title="Permalink to this definition"></a></dt>
<dd><p>Remove the node <code class="docutils literal notranslate"><span class="pre">node_id</span></code> from all the class members.
Initialize all the filtering/indexing structures.</p>
</dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.time_filtering">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">time_filtering</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.time_filtering" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.time_scalar_indexing_strucure">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">time_scalar_indexing_strucure</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.time_scalar_indexing_strucure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.transition_filtering">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">transition_filtering</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.transition_filtering" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.transition_scalar_indexing_structure">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">transition_scalar_indexing_structure</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph.transition_scalar_indexing_structure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph.sample_path">
<span id="pyctbn-pyctbn-structure-graph-sample-path-module"></span><h2>PyCTBN.PyCTBN.structure_graph.sample_path module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.sample_path" title="Permalink to this headline"></a></h2>
<dl class="py class">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.sample_path.</span></span><span class="sig-name descname"><span class="pre">SamplePath</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">importer</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="PyCTBN.PyCTBN.utility.html#PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter" title="PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter"><span class="pre">PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Aggregates all the informations about the trajectories, the real structure of the sampled net and variables
cardinalites. Has the task of creating the objects <code class="docutils literal notranslate"><span class="pre">Trajectory</span></code> and <code class="docutils literal notranslate"><span class="pre">Structure</span></code> that will
contain the mentioned data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>importer</strong> (<a class="reference internal" href="PyCTBN.PyCTBN.utility.html#PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter" title="PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter"><em>AbstractImporter</em></a>) – the Importer object which contains the imported and processed data</p>
</dd>
<dt class="field-even">_trajectories</dt>
<dd class="field-even"><p>the <code class="docutils literal notranslate"><span class="pre">Trajectory</span></code> object that will contain all the concatenated trajectories</p>
</dd>
<dt class="field-odd">_structure</dt>
<dd class="field-odd"><p>the <code class="docutils literal notranslate"><span class="pre">Structure</span></code> Object that will contain all the structural infos about the net</p>
</dd>
<dt class="field-even">_total_variables_count</dt>
<dd class="field-even"><p>the number of variables in the net</p>
</dd>
</dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.build_structure">
<span class="sig-name descname"><span class="pre">build_structure</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.build_structure" title="Permalink to this definition"></a></dt>
<dd><p>Builds the <code class="docutils literal notranslate"><span class="pre">Structure</span></code> object that aggregates all the infos about the net.</p>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.build_trajectories">
<span class="sig-name descname"><span class="pre">build_trajectories</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.build_trajectories" title="Permalink to this definition"></a></dt>
<dd><p>Builds the Trajectory object that will contain all the trajectories.
Clears all the unused dataframes in <code class="docutils literal notranslate"><span class="pre">_importer</span></code> Object</p>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.clear_memory">
<span class="sig-name descname"><span class="pre">clear_memory</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.clear_memory" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.has_prior_net_structure">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">has_prior_net_structure</span></span><em class="property"><span class="pre">:</span> <span class="pre">bool</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.has_prior_net_structure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.structure">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">structure</span></span><em class="property"><span class="pre">:</span> <span class="pre">PyCTBN.PyCTBN.structure_graph.structure.Structure</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.structure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.total_variables_count">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">total_variables_count</span></span><em class="property"><span class="pre">:</span> <span class="pre">int</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.total_variables_count" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.trajectories">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">trajectories</span></span><em class="property"><span class="pre">:</span> <span class="pre">PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath.trajectories" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph.set_of_cims">
<span id="pyctbn-pyctbn-structure-graph-set-of-cims-module"></span><h2>PyCTBN.PyCTBN.structure_graph.set_of_cims module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.set_of_cims" title="Permalink to this headline"></a></h2>
<dl class="py class">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.set_of_cims.</span></span><span class="sig-name descname"><span class="pre">SetOfCims</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parents_states_number</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">node_states_number</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p_combs</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cims</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">numpy.ndarray</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Aggregates all the CIMS of the node identified by the label _node_id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>node_id</strong> – the node label</p></li>
<li><p><strong>parents_states_number</strong> (<em>List</em>) – the cardinalities of the parents</p></li>
<li><p><strong>node_states_number</strong> (<em>int</em>) – the caridinality of the node</p></li>
<li><p><strong>p_combs</strong> (<em>numpy.ndArray</em>) – the p_comb structure bound to this node</p></li>
</ul>
</dd>
<dt class="field-even">_state_residence_time</dt>
<dd class="field-even"><p>matrix containing all the state residence time vectors for the node</p>
</dd>
<dt class="field-odd">_transition_matrices</dt>
<dd class="field-odd"><p>matrix containing all the transition matrices for the node</p>
</dd>
<dt class="field-even">_actual_cims</dt>
<dd class="field-even"><p>the cims of the node</p>
</dd>
</dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.actual_cims">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">actual_cims</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.actual_cims" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.build_cims">
<span class="sig-name descname"><span class="pre">build_cims</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">state_res_times</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">transition_matrices</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">numpy.ndarray</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.build_cims" title="Permalink to this definition"></a></dt>
<dd><p>Build the <code class="docutils literal notranslate"><span class="pre">ConditionalIntensityMatrix</span></code> objects given the state residence times and transitions matrices.
Compute the cim coefficients.The class member <code class="docutils literal notranslate"><span class="pre">_actual_cims</span></code> will contain the computed cims.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>state_res_times</strong> (<em>numpy.ndArray</em>) – the state residence times matrix</p></li>
<li><p><strong>transition_matrices</strong> (<em>numpy.ndArray</em>) – the transition matrices</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.build_times_and_transitions_structures">
<span class="sig-name descname"><span class="pre">build_times_and_transitions_structures</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.build_times_and_transitions_structures" title="Permalink to this definition"></a></dt>
<dd><p>Initializes at the correct dimensions the state residence times matrix and the state transition matrices.</p>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.filter_cims_with_mask">
<span class="sig-name descname"><span class="pre">filter_cims_with_mask</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mask_arr</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">comb</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">numpy.ndarray</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.filter_cims_with_mask" title="Permalink to this definition"></a></dt>
<dd><p>Filter the cims contained in the array <code class="docutils literal notranslate"><span class="pre">_actual_cims</span></code> given the boolean mask <code class="docutils literal notranslate"><span class="pre">mask_arr</span></code> and the index
<code class="docutils literal notranslate"><span class="pre">comb</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mask_arr</strong> (<em>numpy.array</em>) – the boolean mask that indicates which parent to consider</p></li>
<li><p><strong>comb</strong> (<em>numpy.array</em>) – the state/s of the filtered parents</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Array of <code class="docutils literal notranslate"><span class="pre">ConditionalIntensityMatrix</span></code> objects</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.get_cims_number">
<span class="sig-name descname"><span class="pre">get_cims_number</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.get_cims_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.p_combs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">p_combs</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims.p_combs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph.structure">
<span id="pyctbn-pyctbn-structure-graph-structure-module"></span><h2>PyCTBN.PyCTBN.structure_graph.structure module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.structure" title="Permalink to this headline"></a></h2>
<dl class="py class">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.structure.</span></span><span class="sig-name descname"><span class="pre">Structure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nodes_labels_list</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nodes_indexes_arr</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nodes_vals_arr</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges_list</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">total_variables_number</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Contains all the infos about the network structure(nodes labels, nodes caridinalites, edges, indexes)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>nodes_labels_list</strong> (<em>List</em>) – the symbolic names of the variables</p></li>
<li><p><strong>nodes_indexes_arr</strong> (<em>numpy.ndArray</em>) – the indexes of the nodes</p></li>
<li><p><strong>nodes_vals_arr</strong> (<em>numpy.ndArray</em>) – the cardinalites of the nodes</p></li>
<li><p><strong>edges_list</strong> (<em>List</em>) – the edges of the network</p></li>
<li><p><strong>total_variables_number</strong> (<em>int</em>) – the total number of variables in the dataset</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.add_edge">
<span class="sig-name descname"><span class="pre">add_edge</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">edge</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">tuple</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.add_edge" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.clean_structure_edges">
<span class="sig-name descname"><span class="pre">clean_structure_edges</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.clean_structure_edges" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.contains_edge">
<span class="sig-name descname"><span class="pre">contains_edge</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">edge</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">tuple</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">bool</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.contains_edge" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.edges">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">edges</span></span><em class="property"><span class="pre">:</span> <span class="pre">List</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.edges" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.get_node_id">
<span class="sig-name descname"><span class="pre">get_node_id</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_indx</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">str</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.get_node_id" title="Permalink to this definition"></a></dt>
<dd><p>Given the <code class="docutils literal notranslate"><span class="pre">node_index</span></code> returns the node label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node_indx</strong> (<em>int</em>) – the node index</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the node label</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>string</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.get_node_indx">
<span class="sig-name descname"><span class="pre">get_node_indx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">int</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.get_node_indx" title="Permalink to this definition"></a></dt>
<dd><p>Given the <code class="docutils literal notranslate"><span class="pre">node_index</span></code> returns the node label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node_id</strong> (<em>string</em>) – the node label</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the node index</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.get_positional_node_indx">
<span class="sig-name descname"><span class="pre">get_positional_node_indx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">int</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.get_positional_node_indx" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.get_states_number">
<span class="sig-name descname"><span class="pre">get_states_number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">int</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.get_states_number" title="Permalink to this definition"></a></dt>
<dd><p>Given the node label <code class="docutils literal notranslate"><span class="pre">node</span></code> returns the cardinality of the node.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node</strong> (<em>string</em>) – the node label</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the node cardinality</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.nodes_indexes">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nodes_indexes</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.nodes_indexes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.nodes_labels">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nodes_labels</span></span><em class="property"><span class="pre">:</span> <span class="pre">List</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.nodes_labels" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.nodes_values">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nodes_values</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.nodes_values" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.remove_edge">
<span class="sig-name descname"><span class="pre">remove_edge</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">edge</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">tuple</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.remove_edge" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.remove_node">
<span class="sig-name descname"><span class="pre">remove_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node_id</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> &#x2192; <span class="pre">None</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.remove_node" title="Permalink to this definition"></a></dt>
<dd><p>Remove the node <code class="docutils literal notranslate"><span class="pre">node_id</span></code> from all the class members.
The class member <code class="docutils literal notranslate"><span class="pre">_total_variables_number</span></code> since it refers to the total number of variables in the dataset.</p>
</dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.structure.Structure.total_variables_number">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">total_variables_number</span></span><em class="property"><span class="pre">:</span> <span class="pre">int</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.structure.Structure.total_variables_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph.trajectory">
<span id="pyctbn-pyctbn-structure-graph-trajectory-module"></span><h2>PyCTBN.PyCTBN.structure_graph.trajectory module<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph.trajectory" title="Permalink to this headline"></a></h2>
<dl class="py class">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">PyCTBN.PyCTBN.structure_graph.trajectory.</span></span><span class="sig-name descname"><span class="pre">Trajectory</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">list_of_columns</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">original_cols_number</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Abstracts the infos about a complete set of trajectories, represented as a numpy array of doubles
(the time deltas) and a numpy matrix of ints (the changes of states).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>list_of_columns</strong> (<em>List</em>) – the list containing the times array and values matrix</p></li>
<li><p><strong>original_cols_number</strong> (<em>int</em>) – total number of cols in the data</p></li>
</ul>
</dd>
<dt class="field-even">_actual_trajectory</dt>
<dd class="field-even"><p>the trajectory containing also the duplicated/shifted values</p>
</dd>
<dt class="field-odd">_times</dt>
<dd class="field-odd"><p>the array containing the time deltas</p>
</dd>
</dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.complete_trajectory">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">complete_trajectory</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.complete_trajectory" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
3 years ago
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.size">
<span class="sig-name descname"><span class="pre">size</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.times">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">times</span></span><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.times" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
3 years ago
<dl class="py property">
<dt class="sig sig-object py" id="PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.trajectory">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">trajectory</span></span><em class="property"><span class="pre">:</span> <span class="pre">numpy.ndarray</span></em><a class="headerlink" href="#PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory.trajectory" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
3 years ago
</section>
<section id="module-PyCTBN.PyCTBN.structure_graph">
3 years ago
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-PyCTBN.PyCTBN.structure_graph" title="Permalink to this headline"></a></h2>
</section>
</section>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="PyCTBN.PyCTBN.utility.html" class="btn btn-neutral float-right" title="PyCTBN.PyCTBN.utility package">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="PyCTBN.PyCTBN.optimizers.html" class="btn btn-neutral" title="PyCTBN.PyCTBN.optimizers package"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, Bregoli Alessandro, Martini Filippo, Moretti Luca.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/jucacrispim/sphinx_pdj_theme">theme</a> provided by <a href="http://poraodojuca.net">Porão do Juca</a>.
</footer>
</div>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
3 years ago
</script>
<script type="text/javascript" src="_static/documentation_options.js">
</script>
<script type="text/javascript" src="_static/jquery.js">
</script>
<script type="text/javascript" src="_static/underscore.js">
</script>
<script type="text/javascript" src="_static/doctools.js">
</script>
<script type="text/javascript"
src="_static/js/theme.js"></script>
<script type="text/javascript"
src="_static/js/pdj.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>