<liclass="toctree-l2"><aclass="reference internal"href="examples.html#implementing-your-own-data-importer">Implementing your own data importer</a></li>
<spanid="PyCTBN-estimators-fam-score-calculator-module"></span><h2>PyCTBN.estimators.fam_score_calculator module<aclass="headerlink"href="#module-PyCTBN.estimators.fam_score_calculator"title="Permalink to this headline">¶</a></h2>
<emclass="property">class </em><codeclass="sig-prename descclassname">PyCTBN.estimators.fam_score_calculator.</code><codeclass="sig-name descname">FamScoreCalculator</code><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">get_fam_score</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cims</span><spanclass="p">:</span><spanclass="n">numpy.array</span></em>, <emclass="sig-param"><spanclass="n">tau_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">0.1</span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">1</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.get_fam_score"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">marginal_likelihood_q</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cims</span><spanclass="p">:</span><spanclass="n">numpy.array</span></em>, <emclass="sig-param"><spanclass="n">tau_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">0.1</span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">1</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.marginal_likelihood_q"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">marginal_likelihood_theta</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cims</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"title="PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix">PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix</a></span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span></em>, <emclass="sig-param"><spanclass="n">alpha_xxu</span><spanclass="p">:</span><spanclass="n">float</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.marginal_likelihood_theta"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">single_cim_xu_marginal_likelihood_q</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">M_xu_suff_stats</span><spanclass="p">:</span><spanclass="n">float</span></em>, <emclass="sig-param"><spanclass="n">T_xu_suff_stats</span><spanclass="p">:</span><spanclass="n">float</span></em>, <emclass="sig-param"><spanclass="n">tau_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">0.1</span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">1</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.single_cim_xu_marginal_likelihood_q"title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the marginal likelihood on q of the node when assumes a specif value
and a specif parents’s assignment</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>M_xu_suff_stats</strong> – value of the suffucient statistic M[x|u]</p></li>
<li><p><strong>T_xu_suff_stats</strong> (<em>float</em>) – value of the suffucient statistic T[x|u]</p></li>
<li><p><strong>cim</strong> (<em>class:'ConditionalIntensityMatrix'</em>) – A conditional_intensity_matrix object with the sufficient statistics</p></li>
<li><p><strong>tau_xu</strong> (<em>float</em>) – hyperparameter over the CTBN’s q parameters</p></li>
<li><p><strong>alpha_xu</strong> (<em>float</em>) – hyperparameter over the CTBN’s q parameters</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>the value of the marginal likelihood of the node when assumes a specif value</p>
<codeclass="sig-name descname">single_cim_xu_marginal_likelihood_theta</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">index</span><spanclass="p">:</span><spanclass="n">int</span></em>, <emclass="sig-param"><spanclass="n">cim</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"title="PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix">PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix</a></span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span></em>, <emclass="sig-param"><spanclass="n">alpha_xxu</span><spanclass="p">:</span><spanclass="n">float</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.single_cim_xu_marginal_likelihood_theta"title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the marginal likelihood on q of the node when assumes a specif value
and a specif parents’s assignment</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>cim</strong> (<em>class:'ConditionalIntensityMatrix'</em>) – A conditional_intensity_matrix object with the sufficient statistics</p></li>
<li><p><strong>alpha_xu</strong> (<em>float</em>) – hyperparameter over the CTBN’s q parameters</p></li>
<li><p><strong>alpha_xxu</strong> (<em>float</em>) – distribuited hyperparameter over the CTBN’s theta parameters</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>the value of the marginal likelihood over theta when the node assumes a specif value</p>
<codeclass="sig-name descname">single_internal_cim_xxu_marginal_likelihood_theta</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">M_xxu_suff_stats</span><spanclass="p">:</span><spanclass="n">float</span></em>, <emclass="sig-param"><spanclass="n">alpha_xxu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">1</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.single_internal_cim_xxu_marginal_likelihood_theta"title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the second part of the marginal likelihood over theta formula</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>M_xxu_suff_stats</strong> (<em>float</em>) – value of the suffucient statistic M[xx’<ahref="#id1"><spanclass="problematic"id="id2">|</span></a>u]</p></li>
<li><p><strong>alpha_xxu</strong> (<em>float</em>) – distribuited hyperparameter over the CTBN’s theta parameters</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>the value of the marginal likelihood over theta when the node assumes a specif value</p>
<codeclass="sig-name descname">variable_cim_xu_marginal_likelihood_q</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cim</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"title="PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix">PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix</a></span></em>, <emclass="sig-param"><spanclass="n">tau_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">0.1</span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span><spanclass="o">=</span><spanclass="default_value">1</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.variable_cim_xu_marginal_likelihood_q"title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the value of the marginal likelihood over q given a cim</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>cim</strong> (<em>class:'ConditionalIntensityMatrix'</em>) – A conditional_intensity_matrix object with the sufficient statistics</p></li>
<li><p><strong>tau_xu</strong> (<em>float</em>) – hyperparameter over the CTBN’s q parameters</p></li>
<li><p><strong>alpha_xu</strong> (<em>float</em>) – hyperparameter over the CTBN’s q parameters</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>the value of the marginal likelihood over q</p>
<codeclass="sig-name descname">variable_cim_xu_marginal_likelihood_theta</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cim</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"title="PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix">PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix</a></span></em>, <emclass="sig-param"><spanclass="n">alpha_xu</span><spanclass="p">:</span><spanclass="n">float</span></em>, <emclass="sig-param"><spanclass="n">alpha_xxu</span><spanclass="p">:</span><spanclass="n">float</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.fam_score_calculator.FamScoreCalculator.variable_cim_xu_marginal_likelihood_theta"title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the value of the marginal likelihood over theta given a cim</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>cim</strong> (<em>class:'ConditionalIntensityMatrix'</em>) – A conditional_intensity_matrix object with the sufficient statistics</p></li>
<li><p><strong>alpha_xu</strong> (<em>float</em>) – hyperparameter over the CTBN’s q parameters, default to 0.1</p></li>
<li><p><strong>alpha_xxu</strong> (<em>float</em>) – distribuited hyperparameter over the CTBN’s theta parameters</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>the value of the marginal likelihood over theta</p>
<spanid="PyCTBN-estimators-parameters-estimator-module"></span><h2>PyCTBN.estimators.parameters_estimator module<aclass="headerlink"href="#module-PyCTBN.estimators.parameters_estimator"title="Permalink to this headline">¶</a></h2>
<emclass="property">class </em><codeclass="sig-prename descclassname">PyCTBN.estimators.parameters_estimator.</code><codeclass="sig-name descname">ParametersEstimator</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">trajectories</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.trajectory.Trajectory"title="PyCTBN.structure_graph.trajectory.Trajectory">PyCTBN.structure_graph.trajectory.Trajectory</a></span></em>, <emclass="sig-param"><spanclass="n">net_graph</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.network_graph.NetworkGraph"title="PyCTBN.structure_graph.network_graph.NetworkGraph">PyCTBN.structure_graph.network_graph.NetworkGraph</a></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.parameters_estimator.ParametersEstimator"title="Permalink to this definition">¶</a></dt>
<li><p><strong>trajectories</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.trajectory.Trajectory"title="PyCTBN.structure_graph.trajectory.Trajectory"><em>Trajectory</em></a>) – the trajectories</p></li>
<li><p><strong>net_graph</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.network_graph.NetworkGraph"title="PyCTBN.structure_graph.network_graph.NetworkGraph"><em>NetworkGraph</em></a>) – the net structure</p></li>
<codeclass="sig-name descname">compute_parameters</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.parameters_estimator.ParametersEstimator.compute_parameters"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">compute_parameters_for_node</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">node_id</span><spanclass="p">:</span><spanclass="n">str</span></em><spanclass="sig-paren">)</span>→<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.set_of_cims.SetOfCims"title="PyCTBN.structure_graph.set_of_cims.SetOfCims">PyCTBN.structure_graph.set_of_cims.SetOfCims</a><aclass="headerlink"href="#PyCTBN.estimators.parameters_estimator.ParametersEstimator.compute_parameters_for_node"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the state residence times for a node and fill the matrix <codeclass="docutils literal notranslate"><spanclass="pre">T</span></code> with the results</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>node_indx</strong> (<em>int</em>) – the index of the node</p></li>
<li><p><strong>times</strong> (<em>numpy.array</em>) – the times deltas vector</p></li>
<li><p><strong>trajectory</strong> (<em>numpy.ndArray</em>) – the trajectory</p></li>
<li><p><strong>cols_filter</strong> (<em>numpy.array</em>) – the columns filtering structure</p></li>
<li><p><strong>scalar_indexes_struct</strong> (<em>numpy.array</em>) – the indexing structure</p></li>
<li><p><strong>T</strong> (<em>numpy.ndArray</em>) – the state residence times vectors</p></li>
<dd><p>Compute the state residence times for a node and fill the matrices <codeclass="docutils literal notranslate"><spanclass="pre">M</span></code> with the results.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>node_indx</strong> (<em>int</em>) – the index of the node</p></li>
<li><p><strong>trajectory</strong> (<em>numpy.ndArray</em>) – the trajectory</p></li>
<li><p><strong>cols_filter</strong> (<em>numpy.array</em>) – the columns filtering structure</p></li>
<li><p><strong>scalar_indexing</strong> (<em>numpy.array</em>) – the indexing structure</p></li>
<li><p><strong>M</strong> (<em>numpy.ndArray</em>) – the state transitions matrices</p></li>
<codeclass="sig-name descname">fast_init</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">node_id</span><spanclass="p">:</span><spanclass="n">str</span></em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#PyCTBN.estimators.parameters_estimator.ParametersEstimator.fast_init"title="Permalink to this definition">¶</a></dt>
<dd><p>Initializes all the necessary structures for the parameters estimation for the node <codeclass="docutils literal notranslate"><spanclass="pre">node_id</span></code>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>node_id</strong> (<em>string</em>) – the node label</p>
<codeclass="sig-name descname">init_sets_cims_container</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.parameters_estimator.ParametersEstimator.init_sets_cims_container"title="Permalink to this definition">¶</a></dt>
<spanid="PyCTBN-estimators-structure-constraint-based-estimator-module"></span><h2>PyCTBN.estimators.structure_constraint_based_estimator module<aclass="headerlink"href="#module-PyCTBN.estimators.structure_constraint_based_estimator"title="Permalink to this headline">¶</a></h2>
<li><p><strong>sample_path</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.sample_path.SamplePath"title="PyCTBN.structure_graph.sample_path.SamplePath"><em>SamplePath</em></a>) – the _sample_path object containing the trajectories and the real structure</p></li>
<ddclass="field-odd"><p>the complete directed graph built using the nodes labels in <codeclass="docutils literal notranslate"><spanclass="pre">_nodes</span></code></p>
<dd><p>Performs a complete independence test on the directed graphs G1 = {test_child U parent_set}
G2 = {G1 U test_parent} (added as an additional parent of the test_child).
Generates all the necessary structures and datas to perform the tests.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>test_parent</strong> (<em>string</em>) – the node label of the test parent</p></li>
<li><p><strong>test_child</strong> (<em>string</em>) – the node label of the child</p></li>
<li><p><strong>parent_set</strong> (<em>List</em>) – the common parent set</p></li>
<li><p><strong>child_states_numb</strong> (<em>int</em>) – the cardinality of the <codeclass="docutils literal notranslate"><spanclass="pre">test_child</span></code></p></li>
<li><p><strong>tot_vars_count</strong> (<em>int</em>) – the total number of variables in the net</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>True iff test_child and test_parent are independent given the sep_set parent_set. False otherwise</p>
<codeclass="sig-name descname">compute_thumb_value</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">parent_val</span></em>, <emclass="sig-param"><spanclass="n">child_val</span></em>, <emclass="sig-param"><spanclass="n">parent_set_vals</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator.compute_thumb_value"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">ctpc_algorithm</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">disable_multiprocessing</span><spanclass="p">:</span><spanclass="n">bool</span><spanclass="o">=</span><spanclass="default_value">False</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator.ctpc_algorithm"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">estimate_structure</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">disable_multiprocessing</span><spanclass="p">:</span><spanclass="n">bool</span><spanclass="o">=</span><spanclass="default_value">False</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator.estimate_structure"title="Permalink to this definition">¶</a></dt>
<li><p><strong>cim1</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"title="PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"><em>ConditionalIntensityMatrix</em></a>) – a cim belonging to the graph without test parent</p></li>
<li><p><strong>cim2</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"title="PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix"><em>ConditionalIntensityMatrix</em></a>) – a cim belonging to the graph with test parent</p></li>
<codeclass="sig-name descname">one_iteration_of_CTPC_algorithm</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">var_id</span><spanclass="p">:</span><spanclass="n">str</span></em>, <emclass="sig-param"><spanclass="n">tot_vars_count</span><spanclass="p">:</span><spanclass="n">int</span></em><spanclass="sig-paren">)</span>→ List<aclass="headerlink"href="#PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator.one_iteration_of_CTPC_algorithm"title="Permalink to this definition">¶</a></dt>
<dd><p>Performs an iteration of the CTPC algorithm using the node <codeclass="docutils literal notranslate"><spanclass="pre">var_id</span></code> as <codeclass="docutils literal notranslate"><spanclass="pre">test_child</span></code>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>var_id</strong> (<em>string</em>) – the node label of the test child</p>
<spanid="PyCTBN-estimators-structure-estimator-module"></span><h2>PyCTBN.estimators.structure_estimator module<aclass="headerlink"href="#module-PyCTBN.estimators.structure_estimator"title="Permalink to this headline">¶</a></h2>
<emclass="property">class </em><codeclass="sig-prename descclassname">PyCTBN.estimators.structure_estimator.</code><codeclass="sig-name descname">StructureEstimator</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">sample_path</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.sample_path.SamplePath"title="PyCTBN.structure_graph.sample_path.SamplePath">PyCTBN.structure_graph.sample_path.SamplePath</a></span></em>, <emclass="sig-param"><spanclass="n">known_edges</span><spanclass="p">:</span><spanclass="n">List</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator"title="Permalink to this definition">¶</a></dt>
<p>Has the task of estimating the network structure given the trajectories in <codeclass="docutils literal notranslate"><spanclass="pre">samplepath</span></code>.</p>
<ddclass="field-odd"><p><strong>sample_path</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.sample_path.SamplePath"title="PyCTBN.structure_graph.sample_path.SamplePath"><em>SamplePath</em></a>) – the _sample_path object containing the trajectories and the real structure</p>
<ddclass="field-odd"><p>the complete directed graph built using the nodes labels in <codeclass="docutils literal notranslate"><spanclass="pre">_nodes</span></code></p>
<codeclass="sig-name descname">adjacency_matrix</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ numpy.ndarray<aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.adjacency_matrix"title="Permalink to this definition">¶</a></dt>
<dd><p>Converts the estimated structure <codeclass="docutils literal notranslate"><spanclass="pre">_complete_graph</span></code> to a boolean adjacency matrix representation.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>The adjacency matrix of the graph <codeclass="docutils literal notranslate"><spanclass="pre">_complete_graph</span></code></p>
<emclass="property">static </em><codeclass="sig-name descname">build_complete_graph</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">node_ids</span><spanclass="p">:</span><spanclass="n">List</span></em><spanclass="sig-paren">)</span>→ networkx.PyCTBN.digraph.DiGraph<aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.build_complete_graph"title="Permalink to this definition">¶</a></dt>
<dd><p>Builds a complete directed graph (no self loops) given the nodes labels in the list <codeclass="docutils literal notranslate"><spanclass="pre">node_ids</span></code>:</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>node_ids</strong> (<em>List</em>) – the list of nodes labels</p>
<codeclass="sig-name descname">build_removable_edges_matrix</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">known_edges</span><spanclass="p">:</span><spanclass="n">List</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.build_removable_edges_matrix"title="Permalink to this definition">¶</a></dt>
<emclass="property">abstract </em><codeclass="sig-name descname">estimate_structure</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ List<aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.estimate_structure"title="Permalink to this definition">¶</a></dt>
<emclass="property">static </em><codeclass="sig-name descname">generate_possible_sub_sets_of_size</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">u</span><spanclass="p">:</span><spanclass="n">List</span></em>, <emclass="sig-param"><spanclass="n">size</span><spanclass="p">:</span><spanclass="n">int</span></em>, <emclass="sig-param"><spanclass="n">parent_label</span><spanclass="p">:</span><spanclass="n">str</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.generate_possible_sub_sets_of_size"title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a list containing all possible subsets of the list <codeclass="docutils literal notranslate"><spanclass="pre">u</span></code> of size <codeclass="docutils literal notranslate"><spanclass="pre">size</span></code>,
that do not contains a the node identified by <codeclass="docutils literal notranslate"><spanclass="pre">parent_label</span></code>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>u</strong> (<em>List</em>) – the list of nodes</p></li>
<li><p><strong>size</strong> (<em>int</em>) – the size of the subsets</p></li>
<li><p><strong>parent_label</strong> (<em>string</em>) – the node to exclude in the subsets generation</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>an Iterator Object containing a list of lists</p>
<codeclass="sig-name descname">remove_diagonal_elements</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">matrix</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.remove_diagonal_elements"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">save_plot_estimated_structure_graph</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.save_plot_estimated_structure_graph"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">save_results</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.save_results"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">spurious_edges</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ List<aclass="headerlink"href="#PyCTBN.estimators.structure_estimator.StructureEstimator.spurious_edges"title="Permalink to this definition">¶</a></dt>
<dt>Return the spurious edges present in the estimated structure, if a prior net structure is present in</dt><dd><p><codeclass="docutils literal notranslate"><spanclass="pre">_sample_path.structure</span></code>.</p>
</dd>
</dl>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p>A list containing the spurious edges</p>
<spanid="PyCTBN-estimators-structure-score-based-estimator-module"></span><h2>PyCTBN.estimators.structure_score_based_estimator module<aclass="headerlink"href="#module-PyCTBN.estimators.structure_score_based_estimator"title="Permalink to this headline">¶</a></h2>
<li><p><strong>sample_path</strong> (<aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.sample_path.SamplePath"title="PyCTBN.structure_graph.sample_path.SamplePath"><em>SamplePath</em></a>) – the _sample_path object containing the trajectories and the real structure</p></li>
<dd><p>Use the FamScore of a node in order to find the best parent nodes</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>node_id</strong> (<em>string</em>) – current node’s id</p></li>
<li><p><strong>max_parents</strong> (<em>int</em><em>, </em><em>optional</em>) – maximum number of parents for each variable. If None, disabled, default to None</p></li>
<li><p><strong>iterations_number</strong> (<em>int</em><em>, </em><em>optional</em>) – maximum number of optimization algorithm’s iteration, default to 40</p></li>
<li><p><strong>patience</strong> (<em>int</em><em>, </em><em>optional</em>) – number of iteration without any improvement before to stop the search.If None, disabled, default to None</p></li>
<li><p><strong>tabu_length</strong> (<em>int</em><em>, </em><em>optional</em>) – maximum lenght of the data structures used in the optimization process, default to None</p></li>
<li><p><strong>tabu_rules_duration</strong> (<em>int</em><em>, </em><em>optional</em>) – number of iterations in which each rule keeps its value, default to None</p></li>
<li><p><strong>optimizer</strong> (<em>string</em><em>, </em><em>optional</em>) – name of the optimizer algorithm. Possible values: ‘hill’ (Hill climbing),’tabu’ (tabu search), defualt to ‘tabu’</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>A list of the best edges for the currente node</p>
<dd><p>Compute the score-based algorithm to find the optimal structure</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>max_parents</strong> (<em>int</em><em>, </em><em>optional</em>) – maximum number of parents for each variable. If None, disabled, default to None</p></li>
<li><p><strong>iterations_number</strong> (<em>int</em><em>, </em><em>optional</em>) – maximum number of optimization algorithm’s iteration, default to 40</p></li>
<li><p><strong>patience</strong> (<em>int</em><em>, </em><em>optional</em>) – number of iteration without any improvement before to stop the search.If None, disabled, default to None</p></li>
<li><p><strong>tabu_length</strong> (<em>int</em><em>, </em><em>optional</em>) – maximum lenght of the data structures used in the optimization process, default to None</p></li>
<li><p><strong>tabu_rules_duration</strong> (<em>int</em><em>, </em><em>optional</em>) – number of iterations in which each rule keeps its value, default to None</p></li>
<li><p><strong>optimizer</strong> (<em>string</em><em>, </em><em>optional</em>) – name of the optimizer algorithm. Possible values: ‘hill’ (Hill climbing),’tabu’ (tabu search), defualt to ‘tabu’</p></li>
<li><p><strong>disable_multiprocessing</strong> (<em>Boolean</em><em>, </em><em>optional</em>) – true if you desire to disable the multiprocessing operations, default to False</p></li>
<codeclass="sig-name descname">get_score_from_graph</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">graph</span><spanclass="p">:</span><spanclass="n"><aclass="reference internal"href="PyCTBN.structure_graph.html#PyCTBN.structure_graph.network_graph.NetworkGraph"title="PyCTBN.structure_graph.network_graph.NetworkGraph">PyCTBN.structure_graph.network_graph.NetworkGraph</a></span></em>, <emclass="sig-param"><spanclass="n">node_id</span><spanclass="p">:</span><spanclass="n">str</span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator.get_score_from_graph"title="Permalink to this definition">¶</a></dt>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/jucacrispim/sphinx_pdj_theme">theme</a> provided by <ahref="http://poraodojuca.net">Porão do Juca</a>.