1
0
Fork 0

Refactor on docs; Add performance comparison

parallel_struct_est
Filippo Martini 4 years ago
parent 1954487500
commit de1240e7fd
  1. 18
      PyCTBN/PyCTBN/abstract_importer.py
  2. 2
      PyCTBN/PyCTBN/cache.py
  3. 12
      PyCTBN/PyCTBN/json_importer.py
  4. 1
      PyCTBN/PyCTBN/network_graph.py
  5. 4
      PyCTBN/PyCTBN/parameters_estimator.py
  6. 3
      PyCTBN/PyCTBN/sample_path.py
  7. 1
      PyCTBN/PyCTBN/set_of_cims.py
  8. 21
      PyCTBN/PyCTBN/structure_estimator.py
  9. 0
      PyCTBN/deprecated/__init__.py
  10. 0
      PyCTBN/deprecated/sets_of_cims_container.py
  11. 7
      PyCTBN/deprecated/simple_cvs_importer.py
  12. 2
      PyCTBN/tests/original_ctpc_algorithm.py
  13. 70
      PyCTBN/tests/performance_comparisons.py
  14. 101
      documentation/PyCTBN.rst
  15. BIN
      documentation/_build/doctrees/PyCTBN.doctree
  16. BIN
      documentation/_build/doctrees/environment.pickle
  17. BIN
      documentation/_build/doctrees/examples.doctree
  18. BIN
      documentation/_build/doctrees/index.doctree
  19. BIN
      documentation/_build/doctrees/modules.doctree
  20. BIN
      documentation/_build/doctrees/rst/abstract_importer.doctree
  21. BIN
      documentation/_build/doctrees/rst/cache.doctree
  22. BIN
      documentation/_build/doctrees/rst/conditional_intensity_matrix.doctree
  23. BIN
      documentation/_build/doctrees/rst/json_importer.doctree
  24. BIN
      documentation/_build/doctrees/rst/network_graph.doctree
  25. BIN
      documentation/_build/doctrees/rst/parameters_estimator.doctree
  26. BIN
      documentation/_build/doctrees/rst/sample_path.doctree
  27. BIN
      documentation/_build/doctrees/rst/set_of_cims.doctree
  28. BIN
      documentation/_build/doctrees/rst/structure.doctree
  29. BIN
      documentation/_build/doctrees/rst/structure_estimator.doctree
  30. BIN
      documentation/_build/doctrees/rst/trajectory.doctree
  31. 2
      documentation/_build/html/.buildinfo
  32. 1452
      documentation/_build/html/PyCTBN.html
  33. 101
      documentation/_build/html/_sources/PyCTBN.rst.txt
  34. 123
      documentation/_build/html/_sources/examples.rst.txt
  35. 5
      documentation/_build/html/_sources/index.rst.txt
  36. 7
      documentation/_build/html/_sources/modules.rst.txt
  37. 7
      documentation/_build/html/_sources/rst/abstract_importer.rst.txt
  38. 7
      documentation/_build/html/_sources/rst/cache.rst.txt
  39. 7
      documentation/_build/html/_sources/rst/conditional_intensity_matrix.rst.txt
  40. 7
      documentation/_build/html/_sources/rst/json_importer.rst.txt
  41. 17
      documentation/_build/html/_sources/rst/modules.rst.txt
  42. 7
      documentation/_build/html/_sources/rst/network_graph.rst.txt
  43. 7
      documentation/_build/html/_sources/rst/parameters_estimator.rst.txt
  44. 7
      documentation/_build/html/_sources/rst/sample_path.rst.txt
  45. 7
      documentation/_build/html/_sources/rst/set_of_cims.rst.txt
  46. 7
      documentation/_build/html/_sources/rst/structure.rst.txt
  47. 7
      documentation/_build/html/_sources/rst/structure_estimator.rst.txt
  48. 7
      documentation/_build/html/_sources/rst/trajectory.rst.txt
  49. 2
      documentation/_build/html/_static/documentation_options.js
  50. 7
      documentation/_build/html/_static/pygments.css
  51. 315
      documentation/_build/html/examples.html
  52. 406
      documentation/_build/html/genindex.html
  53. 73
      documentation/_build/html/index.html
  54. 210
      documentation/_build/html/modules.html
  55. BIN
      documentation/_build/html/objects.inv
  56. 141
      documentation/_build/html/py-modindex.html
  57. 333
      documentation/_build/html/rst/abstract_importer.html
  58. 224
      documentation/_build/html/rst/cache.html
  59. 209
      documentation/_build/html/rst/conditional_intensity_matrix.html
  60. 353
      documentation/_build/html/rst/json_importer.html
  61. 183
      documentation/_build/html/rst/modules.html
  62. 420
      documentation/_build/html/rst/network_graph.html
  63. 250
      documentation/_build/html/rst/parameters_estimator.html
  64. 219
      documentation/_build/html/rst/sample_path.html
  65. 251
      documentation/_build/html/rst/set_of_cims.html
  66. 267
      documentation/_build/html/rst/structure.html
  67. 309
      documentation/_build/html/rst/structure_estimator.html
  68. 210
      documentation/_build/html/rst/trajectory.html
  69. 37
      documentation/_build/html/search.html
  70. 2
      documentation/_build/html/searchindex.js
  71. 12
      documentation/conf.py
  72. 123
      documentation/examples.rst
  73. 5
      documentation/index.rst
  74. 7
      documentation/modules.rst
  75. 48
      documentation/rst/abstract_importer.rst
  76. 7
      documentation/rst/cache.rst
  77. 7
      documentation/rst/conditional_intensity_matrix.rst
  78. 7
      documentation/rst/json_importer.rst
  79. 17
      documentation/rst/modules.rst
  80. 7
      documentation/rst/network_graph.rst
  81. 7
      documentation/rst/parameters_estimator.rst
  82. 7
      documentation/rst/sample_path.rst
  83. 7
      documentation/rst/set_of_cims.rst
  84. 7
      documentation/rst/structure.rst
  85. 7
      documentation/rst/structure_estimator.rst
  86. 7
      documentation/rst/trajectory.rst
  87. 42
      parameters_estimation_example.py
  88. 5
      setup.py
  89. 30
      structure_estimation_example.py
  90. 241
      venv/bin/Activate.ps1
  91. 66
      venv/bin/activate
  92. 25
      venv/bin/activate.csh
  93. 64
      venv/bin/activate.fish
  94. 8
      venv/bin/easy_install
  95. 8
      venv/bin/easy_install-3.9
  96. 8
      venv/bin/f2py
  97. 8
      venv/bin/f2py3
  98. 8
      venv/bin/f2py3.9
  99. 8
      venv/bin/pip
  100. 8
      venv/bin/pip3
  101. Some files were not shown because too many files have changed in this diff Show More

@ -12,15 +12,17 @@ class AbstractImporter(ABC):
:_concatenated_samples: Dataframe containing the concatenation of all the processed trajectories
:_df_structure: Dataframe containing the structure of the network (edges)
:_df_variables: Dataframe containing the nodes cardinalities
:_sorter: A list containing the columns header (excluding the time column) of the `_concatenated_samples`
:_sorter: A list containing the columns header (excluding the time column) of the ``_concatenated_samples``
.. warning::
The class members ``_df_variables`` and ``_df_structure`` HAVE to be properly constructed
as Pandas Dataframes with the following structure:
Header of _df_structure = [From_Node | To_Node]
Header of _df_variables = [Variable_Label | Variable_Cardinality]
.. note::
See :class:``JsonImporter`` for an example implementation
The class members ``_df_variables`` and ``_df_structure`` HAVE to be properly constructed
as Pandas Dataframes with the following structure:
Header of _df_structure = [From_Node | To_Node]
Header of _df_variables = [Variable_Label | Variable_Cardinality]
.. note::
See :class:``JsonImporter`` for an example implementation
"""
def __init__(self, file_path: str):
@ -32,7 +34,7 @@ class AbstractImporter(ABC):
self._concatenated_samples = None
self._sorter = None
super().__init__()
@abstractmethod
def build_sorter(self, sample_frame: pd.DataFrame) -> typing.List:
"""Initializes the ``_sorter`` class member from a trajectory dataframe, exctracting the header of the frame

@ -1,6 +1,6 @@
import typing
#import set_of_cims as sofc
from .set_of_cims import SetOfCims

@ -3,18 +3,13 @@ import json
import typing
import pandas as pd
#import abstract_importer as ai
from .abstract_importer import AbstractImporter
class JsonImporter(AbstractImporter):
"""Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare
the data in json extension with the following structure:
[0]
|_ dyn.cims
|_ dyn.str
|_ samples
|_ variabels
the data in json extension.
:param file_path: the path of the file that contains tha data to be imported
:type file_path: string
:param samples_label: the reference key for the samples in the trajectories
@ -41,6 +36,7 @@ class JsonImporter(AbstractImporter):
.. note::
This constructor calls also the method ``read_json_file()``, so after the construction of the object
the class member ``_raw_data`` will contain the raw imported json data.
"""
self._samples_label = samples_label
self._structure_label = structure_label
@ -139,7 +135,7 @@ class JsonImporter(AbstractImporter):
return df_samples_list
def build_sorter(self, sample_frame: pd.DataFrame) -> typing.List:
"""Implements the abstract method build_sorter of the :class:`AbstractImporter` for this dataset
"""Implements the abstract method build_sorter of the :class:`AbstractImporter` for this dataset.
"""
columns_header = list(sample_frame.columns.values)
columns_header.remove(self._time_key)

@ -3,7 +3,6 @@ import typing
import networkx as nx
import numpy as np
#import structure as st
from .structure import Structure

@ -1,15 +1,11 @@
import numpy as np
#import network_graph as ng
#import trajectory as tr
#import set_of_cims as sofc
from .trajectory import Trajectory
from .set_of_cims import SetOfCims
from .network_graph import NetworkGraph
class ParametersEstimator:
"""Has the task of computing the cims of particular node given the trajectories and the net structure
in the graph ``_net_graph``.

@ -1,7 +1,4 @@
#import abstract_importer as imp
#import structure as st
#import trajectory as tr
from .abstract_importer import AbstractImporter
from .structure import Structure
from .trajectory import Trajectory

@ -1,7 +1,6 @@
import typing
import numpy as np
#import conditional_intensity_matrix as cim
from .conditional_intensity_matrix import ConditionalIntensityMatrix

@ -1,5 +1,4 @@
from tqdm import tqdm
import itertools
import json
@ -10,12 +9,6 @@ from networkx.readwrite import json_graph
from scipy.stats import chi2 as chi2_dist
from scipy.stats import f as f_dist
#import cache as ch
#import conditional_intensity_matrix as condim
#import network_graph as ng
#import parameters_estimator as pe
#import sample_path as sp
#import structure as st
from .cache import Cache
from .conditional_intensity_matrix import ConditionalIntensityMatrix
from .network_graph import NetworkGraph
@ -144,7 +137,7 @@ class StructureEstimator:
:type cim1: ConditionalIntensityMatrix
:param cim2: a cim belonging to the graph with test parent
:type cim2: ConditionalIntensityMatrix
:return:True iff both tests do NOT reject the null hypothesis of indipendence. False otherwise.
:return: True iff both tests do NOT reject the null hypothesis of independence. False otherwise.
:rtype: bool
"""
M1 = cim1.state_transition_matrix
@ -180,7 +173,6 @@ class StructureEstimator:
:param tot_vars_count: the number of _nodes in the net
:type tot_vars_count: int
"""
#print("##################TESTING VAR################", var_id)
u = list(self._complete_graph.predecessors(var_id))
child_states_numb = self._sample_path.structure.get_states_number(var_id)
b = 0
@ -228,8 +220,7 @@ class StructureEstimator:
def save_results(self) -> None:
"""Save the estimated Structure to a .json file in the path where the data are loaded from.
The file is named as the input dataset but the results_ word is appendend to the results file.
The file is named as the input dataset but the `results_` word is appended to the results file.
"""
res = json_graph.node_link_data(self._complete_graph)
name = self._sample_path._importer.file_path.rsplit('/', 1)[-1] + str(self._sample_path._importer.dataset_id())
@ -237,4 +228,12 @@ class StructureEstimator:
with open(name, 'w') as f:
json.dump(res, f)
def adjacency_matrix(self) -> np.ndarray:
"""Converts the estimated structrure ``_complete_graph`` to a boolean adjacency matrix representation.
:return: The adjacency matrix of the graph ``_complete_graph``
:rtype: numpy.ndArray
"""
return nx.adj_matrix(self._complete_graph).toarray().astype(bool)

@ -1,11 +1,10 @@
import pandas as pd
import glob
import os
import typing
from .abstract_importer import AbstractImporter
from .sample_path import SamplePath
from PyCTBN.PyCTBN.abstract_importer import AbstractImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
class CSVImporter(AbstractImporter):
@ -45,7 +44,7 @@ class CSVImporter(AbstractImporter):
def main():
read_files = glob.glob(os.path.join('../data', "*.csv"))
read_files = glob.glob(os.path.join('../../data', "*.csv"))
print(read_files[0])
csvimp = CSVImporter(read_files[0])
s1 = SamplePath(csvimp)

@ -9,7 +9,7 @@ from scipy.stats import chi2 as chi2_dist
from scipy.stats import f as f_dist
from tqdm import tqdm
from .abstract_importer import AbstractImporter
from PyCTBN.PyCTBN.abstract_importer import AbstractImporter
class OriginalCTPCAlgorithm(AbstractImporter):

@ -0,0 +1,70 @@
import unittest
import os
import glob
import numpy as np
import pandas as pd
import timeit
from ..PyCTBN.sample_path import SamplePath
from ..PyCTBN.structure_estimator import StructureEstimator
from ..PyCTBN.json_importer import JsonImporter
from PyCTBN.tests.original_ctpc_algorithm import OriginalCTPCAlgorithm
class PerformanceComparisons(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.read_files = glob.glob(os.path.join('./data', "*.json"))
cls.datasets_numb = None
cls.s1 = None
cls.importer = None
cls.original_algo = None
cls.original_times = []
cls.optimized_times = []
cls.results = []
def test_time_comparisons(self):
for file_path in self.read_files:
self.importer = JsonImporter(file_path, 'samples', 'dyn.str', 'variables', 'Time', 'Name')
self.original_algo = OriginalCTPCAlgorithm(file_path, 'samples', 'dyn.str', 'variables',
'Time', 'Name', self.importer._raw_data)
self.datasets_numb = self.original_algo.datasets_numb()
print("Testing on file: ", file_path, " with ", self.datasets_numb, " Datasets")
for indx in range(self.datasets_numb):
print("Running Test: ", indx)
self.aux_build_importer(indx)
self.aux_build_original_algo(indx)
se1 = StructureEstimator(self.s1, 0.1, 0.1)
opt_time = timeit.timeit(se1.ctpc_algorithm, number=1)
original_time = timeit.timeit(self.original_algo.cb_structure_algo, number=1)
opt_res = se1.adjacency_matrix()
original_res = self.original_algo.matrix
self.original_times.append(original_time)
self.optimized_times.append(opt_time)
self.results.append((original_res, opt_res))
self.assertTrue(np.array_equal(original_res, opt_res))
self.save_datas(self.original_times, self.optimized_times)
self.original_times[:] = []
self.optimized_times[:] = []
def aux_build_importer(self, indx):
self.importer.import_data(indx)
self.s1 = SamplePath(self.importer)
self.s1.build_trajectories()
self.s1.build_structure()
def aux_build_original_algo(self, indx):
self.original_algo.import_data(indx)
self.original_algo.prepare_trajectories(self.original_algo.df_samples_list, self.original_algo.variables)
def save_datas(self, original_list, opt_list):
df_results = pd.DataFrame({'orginal_execution_time': original_list, 'optimized_execution_time': opt_list})
name = self.importer.file_path.rsplit('/', 1)[-1]
name = name.split('.', 1)[0]
name = 'execution_times_' + name + '.csv'
df_results.to_csv(name, index=False)
if __name__ == '__main__':
unittest.main()

@ -0,0 +1,101 @@
PyCTBN package
==============
Submodules
----------
PyCTBN.abstract\_importer module
--------------------------------
.. automodule:: PyCTBN.abstract_importer
:members:
:undoc-members:
:show-inheritance:
PyCTBN.cache module
-------------------
.. automodule:: PyCTBN.cache
:members:
:undoc-members:
:show-inheritance:
PyCTBN.conditional\_intensity\_matrix module
--------------------------------------------
.. automodule:: PyCTBN.conditional_intensity_matrix
:members:
:undoc-members:
:show-inheritance:
PyCTBN.json\_importer module
----------------------------
.. automodule:: PyCTBN.json_importer
:members:
:undoc-members:
:show-inheritance:
PyCTBN.network\_graph module
----------------------------
.. automodule:: PyCTBN.network_graph
:members:
:undoc-members:
:show-inheritance:
PyCTBN.parameters\_estimator module
-----------------------------------
.. automodule:: PyCTBN.parameters_estimator
:members:
:undoc-members:
:show-inheritance:
PyCTBN.sample\_path module
--------------------------
.. automodule:: PyCTBN.sample_path
:members:
:undoc-members:
:show-inheritance:
PyCTBN.set\_of\_cims module
---------------------------
.. automodule:: PyCTBN.set_of_cims
:members:
:undoc-members:
:show-inheritance:
PyCTBN.structure module
-----------------------
.. automodule:: PyCTBN.structure
:members:
:undoc-members:
:show-inheritance:
PyCTBN.structure\_estimator module
----------------------------------
.. automodule:: PyCTBN.structure_estimator
:members:
:undoc-members:
:show-inheritance:
PyCTBN.trajectory module
------------------------
.. automodule:: PyCTBN.trajectory
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: PyCTBN
:members:
:undoc-members:
:show-inheritance:

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0c64bed84aa4ce76aedaca18241d82e7
config: 5ff9615d2690725079f899e2857b650e
tags: 645f666f9bcd5a90fca523b33c5a78b7

File diff suppressed because it is too large Load Diff

@ -0,0 +1,101 @@
PyCTBN package
==============
Submodules
----------
PyCTBN.abstract\_importer module
--------------------------------
.. automodule:: PyCTBN.abstract_importer
:members:
:undoc-members:
:show-inheritance:
PyCTBN.cache module
-------------------
.. automodule:: PyCTBN.cache
:members:
:undoc-members:
:show-inheritance:
PyCTBN.conditional\_intensity\_matrix module
--------------------------------------------
.. automodule:: PyCTBN.conditional_intensity_matrix
:members:
:undoc-members:
:show-inheritance:
PyCTBN.json\_importer module
----------------------------
.. automodule:: PyCTBN.json_importer
:members:
:undoc-members:
:show-inheritance:
PyCTBN.network\_graph module
----------------------------
.. automodule:: PyCTBN.network_graph
:members:
:undoc-members:
:show-inheritance:
PyCTBN.parameters\_estimator module
-----------------------------------
.. automodule:: PyCTBN.parameters_estimator
:members:
:undoc-members:
:show-inheritance:
PyCTBN.sample\_path module
--------------------------
.. automodule:: PyCTBN.sample_path
:members:
:undoc-members:
:show-inheritance:
PyCTBN.set\_of\_cims module
---------------------------
.. automodule:: PyCTBN.set_of_cims
:members:
:undoc-members:
:show-inheritance:
PyCTBN.structure module
-----------------------
.. automodule:: PyCTBN.structure
:members:
:undoc-members:
:show-inheritance:
PyCTBN.structure\_estimator module
----------------------------------
.. automodule:: PyCTBN.structure_estimator
:members:
:undoc-members:
:show-inheritance:
PyCTBN.trajectory module
------------------------
.. automodule:: PyCTBN.trajectory
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: PyCTBN
:members:
:undoc-members:
:show-inheritance:

@ -0,0 +1,123 @@
Examples
=============
Installation/Usage:
*******************
Implementing your own data importer
***********************************
.. code-block:: python
"""This example demonstrates the implementation of a simple data importer the extends the class abstract importer to import data in csv format.
The net in exam has three ternary nodes.
"""
from .abstract_importer import AbstractImporter
class CSVImporter(AbstractImporter):
def __init__(self, file_path):
self._df_samples_list = None
super(CSVImporter, self).__init__(file_path)
def import_data(self):
self.read_csv_file()
self._sorter = self.build_sorter(self._df_samples_list[0])
self.import_variables()
self.import_structure()
self.compute_row_delta_in_all_samples_frames(self._df_samples_list)
def read_csv_file(self):
df = pd.read_csv(self._file_path)
df.drop(df.columns[[0]], axis=1, inplace=True)
self._df_samples_list = [df]
def import_variables(self):
values_list = [3 for var in self._sorter]
# initialize dict of lists
data = {'Name':self._sorter, 'Value':values_list}
# Create the pandas DataFrame
self._df_variables = pd.DataFrame(data)
def build_sorter(self, sample_frame: pd.DataFrame) -> typing.List:
return list(sample_frame.columns)[1:]
def import_structure(self):
data = {'From':['X','Y','Z'], 'To':['Z','Z','Y']}
self._df_structure = pd.DataFrame(data)
def dataset_id(self) -> object:
pass
Parameters Estimation Example
*****************************
.. code-block:: python
from PyCTBN.PyCTBN.json_importer import JsonImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
from PyCTBN.PyCTBN.network_graph import NetworkGraph
from PyCTBN.PyCTBN.parameters_estimator import ParametersEstimator
def main():
read_files = glob.glob(os.path.join('./data', "*.json")) #Take all json files in this dir
#import data
importer = JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name')
importer.import_data(0)
#Create a SamplePath Obj passing an already filled AbstractImporter object
s1 = SamplePath(importer)
#Build The trajectries and the structural infos
s1.build_trajectories()
s1.build_structure()
print(s1.structure.edges)
print(s1.structure.nodes_values)
#From The Structure Object build the Graph
g = NetworkGraph(s1.structure)
#Select a node you want to estimate the parameters
node = g.nodes[2]
print("Node", node)
#Init the _graph specifically for THIS node
g.fast_init(node)
#Use SamplePath and Grpah to create a ParametersEstimator Object
p1 = ParametersEstimator(s1.trajectories, g)
#Init the peEst specifically for THIS node
p1.fast_init(node)
#Compute the parameters
sofc1 = p1.compute_parameters_for_node(node)
#The est CIMS are inside the resultant SetOfCIms Obj
print(sofc1.actual_cims)
Structure Estimation Example
****************************
.. code-block:: python
from PyCTBN.PyCTBN.json_importer import JsonImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
from PyCTBN.PyCTBN.structure_estimator import StructureEstimator
def structure_estimation_example():
# read the json files in ./data path
read_files = glob.glob(os.path.join('./data', "*.json"))
# initialize a JsonImporter object for the first file
importer = JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name')
# import the data at index 0 of the outer json array
importer.import_data(0)
# construct a SamplePath Object passing a filled AbstractImporter
s1 = SamplePath(importer)
# build the trajectories
s1.build_trajectories()
# build the real structure
s1.build_structure()
# construct a StructureEstimator object
se1 = StructureEstimator(s1, 0.1, 0.1)
# call the ctpc algorithm
se1.ctpc_algorithm()
# the adjacency matrix of the estimated structure
print(se1.adjacency_matrix())
# save results to a json file
se1.save_results()

@ -1,5 +1,5 @@
.. PyCTBN documentation master file, created by
sphinx-quickstart on Mon Nov 30 16:37:03 2020.
sphinx-quickstart on Mon Dec 7 15:11:12 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
@ -10,7 +10,8 @@ Welcome to PyCTBN's documentation!
:maxdepth: 2
:caption: Contents:
PyCTBN
examples
Indices and tables
==================

@ -0,0 +1,7 @@
PyCTBN
======
.. toctree::
:maxdepth: 4
PyCTBN

@ -1,7 +0,0 @@
abstract\_importer module
=========================
.. automodule:: abstract_importer
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
cache module
============
.. automodule:: cache
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
conditional\_intensity\_matrix module
=====================================
.. automodule:: conditional_intensity_matrix
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
json\_importer module
=====================
.. automodule:: json_importer
:members:
:undoc-members:
:show-inheritance:

@ -1,17 +0,0 @@
scripts
=======
.. toctree::
:maxdepth: 4
abstract_importer
cache
conditional_intensity_matrix
json_importer
network_graph
parameters_estimator
sample_path
set_of_cims
structure
structure_estimator
trajectory

@ -1,7 +0,0 @@
network\_graph module
=====================
.. automodule:: network_graph
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
parameters\_estimator module
============================
.. automodule:: parameters_estimator
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
sample\_path module
===================
.. automodule:: sample_path
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
set\_of\_cims module
====================
.. automodule:: set_of_cims
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
structure module
================
.. automodule:: structure
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
structure\_estimator module
===========================
.. automodule:: structure_estimator
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
trajectory module
=================
.. automodule:: trajectory
:members:
:undoc-members:
:show-inheritance:

@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '',
VERSION: '1.0',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',

@ -1,2 +1,7 @@
pre { line-height: 125%; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight { background: #ffffff; }

@ -0,0 +1,315 @@
<!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>Examples &mdash; PyCTBN 1.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" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="PyCTBN 1.0 documentation" href="index.html"/>
<link rel="prev" title="PyCTBN package" href="PyCTBN.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 class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#installation-usage">Installation/Usage:</a></li>
<li class="toctree-l2"><a class="reference internal" href="#implementing-your-own-data-importer">Implementing your own data importer</a></li>
<li class="toctree-l2"><a class="reference internal" href="#parameters-estimation-example">Parameters Estimation Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="#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">
<div class="section" id="examples">
<h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h1>
<div class="section" id="installation-usage">
<h2>Installation/Usage:<a class="headerlink" href="#installation-usage" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="implementing-your-own-data-importer">
<h2>Implementing your own data importer<a class="headerlink" href="#implementing-your-own-data-importer" title="Permalink to this headline"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="sd">&quot;&quot;&quot;This example demonstrates the implementation of a simple data importer the extends the class abstract importer to import data in csv format.</span>
<span class="sd">The net in exam has three ternary nodes.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">.abstract_importer</span> <span class="kn">import</span> <span class="n">AbstractImporter</span>
<span class="k">class</span> <span class="nc">CSVImporter</span><span class="p">(</span><span class="n">AbstractImporter</span><span class="p">):</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">file_path</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_df_samples_list</span> <span class="o">=</span> <span class="kc">None</span>
<span class="nb">super</span><span class="p">(</span><span class="n">CSVImporter</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">file_path</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">import_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">read_csv_file</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_sorter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">build_sorter</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_df_samples_list</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">import_variables</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">import_structure</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">compute_row_delta_in_all_samples_frames</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_df_samples_list</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">read_csv_file</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_file_path</span><span class="p">)</span>
<span class="n">df</span><span class="o">.</span><span class="n">drop</span><span class="p">(</span><span class="n">df</span><span class="o">.</span><span class="n">columns</span><span class="p">[[</span><span class="mi">0</span><span class="p">]],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_df_samples_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">df</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">import_variables</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">values_list</span> <span class="o">=</span> <span class="p">[</span><span class="mi">3</span> <span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_sorter</span><span class="p">]</span>
<span class="c1"># initialize dict of lists</span>
<span class="n">data</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;Name&#39;</span><span class="p">:</span><span class="bp">self</span><span class="o">.</span><span class="n">_sorter</span><span class="p">,</span> <span class="s1">&#39;Value&#39;</span><span class="p">:</span><span class="n">values_list</span><span class="p">}</span>
<span class="c1"># Create the pandas DataFrame</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_df_variables</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">build_sorter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sample_frame</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">typing</span><span class="o">.</span><span class="n">List</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="n">sample_frame</span><span class="o">.</span><span class="n">columns</span><span class="p">)[</span><span class="mi">1</span><span class="p">:]</span>
<span class="k">def</span> <span class="nf">import_structure</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">data</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;From&#39;</span><span class="p">:[</span><span class="s1">&#39;X&#39;</span><span class="p">,</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span><span class="s1">&#39;Z&#39;</span><span class="p">],</span> <span class="s1">&#39;To&#39;</span><span class="p">:[</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span><span class="s1">&#39;Y&#39;</span><span class="p">]}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_df_structure</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">dataset_id</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">object</span><span class="p">:</span>
<span class="k">pass</span>
</pre></div>
</div>
</div>
<div class="section" id="parameters-estimation-example">
<h2>Parameters Estimation Example<a class="headerlink" href="#parameters-estimation-example" title="Permalink to this headline"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.json_importer</span> <span class="kn">import</span> <span class="n">JsonImporter</span>
<span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.sample_path</span> <span class="kn">import</span> <span class="n">SamplePath</span>
<span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.network_graph</span> <span class="kn">import</span> <span class="n">NetworkGraph</span>
<span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.parameters_estimator</span> <span class="kn">import</span> <span class="n">ParametersEstimator</span>
<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="n">read_files</span> <span class="o">=</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s1">&#39;./data&#39;</span><span class="p">,</span> <span class="s2">&quot;*.json&quot;</span><span class="p">))</span> <span class="c1">#Take all json files in this dir</span>
<span class="c1">#import data</span>
<span class="n">importer</span> <span class="o">=</span> <span class="n">JsonImporter</span><span class="p">(</span><span class="n">read_files</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;samples&#39;</span><span class="p">,</span> <span class="s1">&#39;dyn.str&#39;</span><span class="p">,</span> <span class="s1">&#39;variables&#39;</span><span class="p">,</span> <span class="s1">&#39;Time&#39;</span><span class="p">,</span> <span class="s1">&#39;Name&#39;</span><span class="p">)</span>
<span class="n">importer</span><span class="o">.</span><span class="n">import_data</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="c1">#Create a SamplePath Obj passing an already filled AbstractImporter object</span>
<span class="n">s1</span> <span class="o">=</span> <span class="n">SamplePath</span><span class="p">(</span><span class="n">importer</span><span class="p">)</span>
<span class="c1">#Build The trajectries and the structural infos</span>
<span class="n">s1</span><span class="o">.</span><span class="n">build_trajectories</span><span class="p">()</span>
<span class="n">s1</span><span class="o">.</span><span class="n">build_structure</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="n">s1</span><span class="o">.</span><span class="n">structure</span><span class="o">.</span><span class="n">edges</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">s1</span><span class="o">.</span><span class="n">structure</span><span class="o">.</span><span class="n">nodes_values</span><span class="p">)</span>
<span class="c1">#From The Structure Object build the Graph</span>
<span class="n">g</span> <span class="o">=</span> <span class="n">NetworkGraph</span><span class="p">(</span><span class="n">s1</span><span class="o">.</span><span class="n">structure</span><span class="p">)</span>
<span class="c1">#Select a node you want to estimate the parameters</span>
<span class="n">node</span> <span class="o">=</span> <span class="n">g</span><span class="o">.</span><span class="n">nodes</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Node&quot;</span><span class="p">,</span> <span class="n">node</span><span class="p">)</span>
<span class="c1">#Init the _graph specifically for THIS node</span>
<span class="n">g</span><span class="o">.</span><span class="n">fast_init</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
<span class="c1">#Use SamplePath and Grpah to create a ParametersEstimator Object</span>
<span class="n">p1</span> <span class="o">=</span> <span class="n">ParametersEstimator</span><span class="p">(</span><span class="n">s1</span><span class="o">.</span><span class="n">trajectories</span><span class="p">,</span> <span class="n">g</span><span class="p">)</span>
<span class="c1">#Init the peEst specifically for THIS node</span>
<span class="n">p1</span><span class="o">.</span><span class="n">fast_init</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
<span class="c1">#Compute the parameters</span>
<span class="n">sofc1</span> <span class="o">=</span> <span class="n">p1</span><span class="o">.</span><span class="n">compute_parameters_for_node</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
<span class="c1">#The est CIMS are inside the resultant SetOfCIms Obj</span>
<span class="nb">print</span><span class="p">(</span><span class="n">sofc1</span><span class="o">.</span><span class="n">actual_cims</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="structure-estimation-example">
<h2>Structure Estimation Example<a class="headerlink" href="#structure-estimation-example" title="Permalink to this headline"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.json_importer</span> <span class="kn">import</span> <span class="n">JsonImporter</span>
<span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.sample_path</span> <span class="kn">import</span> <span class="n">SamplePath</span>
<span class="kn">from</span> <span class="nn">PyCTBN.PyCTBN.structure_estimator</span> <span class="kn">import</span> <span class="n">StructureEstimator</span>
<span class="k">def</span> <span class="nf">structure_estimation_example</span><span class="p">():</span>
<span class="c1"># read the json files in ./data path</span>
<span class="n">read_files</span> <span class="o">=</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s1">&#39;./data&#39;</span><span class="p">,</span> <span class="s2">&quot;*.json&quot;</span><span class="p">))</span>
<span class="c1"># initialize a JsonImporter object for the first file</span>
<span class="n">importer</span> <span class="o">=</span> <span class="n">JsonImporter</span><span class="p">(</span><span class="n">read_files</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;samples&#39;</span><span class="p">,</span> <span class="s1">&#39;dyn.str&#39;</span><span class="p">,</span> <span class="s1">&#39;variables&#39;</span><span class="p">,</span> <span class="s1">&#39;Time&#39;</span><span class="p">,</span> <span class="s1">&#39;Name&#39;</span><span class="p">)</span>
<span class="c1"># import the data at index 0 of the outer json array</span>
<span class="n">importer</span><span class="o">.</span><span class="n">import_data</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="c1"># construct a SamplePath Object passing a filled AbstractImporter</span>
<span class="n">s1</span> <span class="o">=</span> <span class="n">SamplePath</span><span class="p">(</span><span class="n">importer</span><span class="p">)</span>
<span class="c1"># build the trajectories</span>
<span class="n">s1</span><span class="o">.</span><span class="n">build_trajectories</span><span class="p">()</span>
<span class="c1"># build the real structure</span>
<span class="n">s1</span><span class="o">.</span><span class="n">build_structure</span><span class="p">()</span>
<span class="c1"># construct a StructureEstimator object</span>
<span class="n">se1</span> <span class="o">=</span> <span class="n">StructureEstimator</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">)</span>
<span class="c1"># call the ctpc algorithm</span>
<span class="n">se1</span><span class="o">.</span><span class="n">ctpc_algorithm</span><span class="p">()</span>
<span class="c1"># the adjacency matrix of the estimated structure</span>
<span class="nb">print</span><span class="p">(</span><span class="n">se1</span><span class="o">.</span><span class="n">adjacency_matrix</span><span class="p">())</span>
<span class="c1"># save results to a json file</span>
<span class="n">se1</span><span class="o">.</span><span class="n">save_results</span><span class="p">()</span>
</pre></div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="PyCTBN.html" class="btn btn-neutral" title="PyCTBN package"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Alessandro Bregoli, Filippo Martini.
</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:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; PyCTBN documentation</title>
<title>Index &mdash; PyCTBN 1.0 documentation</title>
@ -26,7 +26,7 @@
<link rel="index" title="Index"
href="#"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="PyCTBN documentation" href="index.html"/>
<link rel="top" title="PyCTBN 1.0 documentation" href="index.html"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="public" />
@ -58,8 +58,33 @@
<!-- Local TOC -->
<div class="local-toc"></div>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-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>
@ -124,22 +149,17 @@
<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
abstract_importer
<ul>
<li><a href="rst/abstract_importer.html#module-abstract_importer">module</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter">AbstractImporter (class in PyCTBN.abstract_importer)</a>
</li>
</ul></li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter">AbstractImporter (class in abstract_importer)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims.actual_cims">actual_cims() (PyCTBN.set_of_cims.SetOfCims property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims.actual_cims">actual_cims() (set_of_cims.SetOfCims property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.add_edges">add_edges() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.add_edges">add_edges() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.add_nodes">add_nodes() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.add_nodes">add_nodes() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.adjacency_matrix">adjacency_matrix() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
</ul></td>
</tr></table>
@ -147,35 +167,35 @@
<h2 id="B">B</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims.build_cims">build_cims() (set_of_cims.SetOfCims method)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims.build_cims">build_cims() (PyCTBN.set_of_cims.SetOfCims method)</a>
</li>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.build_complete_graph">build_complete_graph() (structure_estimator.StructureEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.build_complete_graph">build_complete_graph() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.build_list_of_samples_array">build_list_of_samples_array() (abstract_importer.AbstractImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.build_list_of_samples_array">build_list_of_samples_array() (PyCTBN.abstract_importer.AbstractImporter method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.build_p_comb_structure_for_a_node">build_p_comb_structure_for_a_node() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.build_p_comb_structure_for_a_node">build_p_comb_structure_for_a_node() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.build_sorter">build_sorter() (abstract_importer.AbstractImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.build_sorter">build_sorter() (PyCTBN.abstract_importer.AbstractImporter method)</a>
<ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.build_sorter">(json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.build_sorter">(PyCTBN.json_importer.JsonImporter method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/sample_path.html#sample_path.SamplePath.build_structure">build_structure() (sample_path.SamplePath method)</a>
<li><a href="PyCTBN.html#PyCTBN.sample_path.SamplePath.build_structure">build_structure() (PyCTBN.sample_path.SamplePath method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.build_time_columns_filtering_for_a_node">build_time_columns_filtering_for_a_node() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.build_time_columns_filtering_for_a_node">build_time_columns_filtering_for_a_node() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.build_time_scalar_indexing_structure_for_a_node">build_time_scalar_indexing_structure_for_a_node() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.build_time_scalar_indexing_structure_for_a_node">build_time_scalar_indexing_structure_for_a_node() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims.build_times_and_transitions_structures">build_times_and_transitions_structures() (set_of_cims.SetOfCims method)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims.build_times_and_transitions_structures">build_times_and_transitions_structures() (PyCTBN.set_of_cims.SetOfCims method)</a>
</li>
<li><a href="rst/sample_path.html#sample_path.SamplePath.build_trajectories">build_trajectories() (sample_path.SamplePath method)</a>
<li><a href="PyCTBN.html#PyCTBN.sample_path.SamplePath.build_trajectories">build_trajectories() (PyCTBN.sample_path.SamplePath method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.build_transition_filtering_for_a_node">build_transition_filtering_for_a_node() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.build_transition_filtering_for_a_node">build_transition_filtering_for_a_node() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.build_transition_scalar_indexing_structure_for_a_node">build_transition_scalar_indexing_structure_for_a_node() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.build_transition_scalar_indexing_structure_for_a_node">build_transition_scalar_indexing_structure_for_a_node() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
</ul></td>
</tr></table>
@ -183,53 +203,39 @@
<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
cache
<ul>
<li><a href="rst/cache.html#module-cache">module</a>
</li>
</ul></li>
<li><a href="rst/cache.html#cache.Cache">Cache (class in cache)</a>
<li><a href="PyCTBN.html#PyCTBN.cache.Cache">Cache (class in PyCTBN.cache)</a>
</li>
<li><a href="rst/conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix.cim">cim() (conditional_intensity_matrix.ConditionalIntensityMatrix property)</a>
<li><a href="PyCTBN.html#PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix.cim">cim() (PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix property)</a>
</li>
<li><a href="rst/cache.html#cache.Cache.clear">clear() (cache.Cache method)</a>
<li><a href="PyCTBN.html#PyCTBN.cache.Cache.clear">clear() (PyCTBN.cache.Cache method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.clear_concatenated_frame">clear_concatenated_frame() (abstract_importer.AbstractImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.clear_concatenated_frame">clear_concatenated_frame() (PyCTBN.abstract_importer.AbstractImporter method)</a>
</li>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.clear_data_frame_list">clear_data_frame_list() (json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.clear_data_frame_list">clear_data_frame_list() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.complete_test">complete_test() (structure_estimator.StructureEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.complete_test">complete_test() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
<li><a href="rst/trajectory.html#trajectory.Trajectory.complete_trajectory">complete_trajectory() (trajectory.Trajectory property)</a>
<li><a href="PyCTBN.html#PyCTBN.trajectory.Trajectory.complete_trajectory">complete_trajectory() (PyCTBN.trajectory.Trajectory property)</a>
</li>
<li><a href="rst/conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix.compute_cim_coefficients">compute_cim_coefficients() (conditional_intensity_matrix.ConditionalIntensityMatrix method)</a>
<li><a href="PyCTBN.html#PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix.compute_cim_coefficients">compute_cim_coefficients() (PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/parameters_estimator.html#parameters_estimator.ParametersEstimator.compute_parameters_for_node">compute_parameters_for_node() (parameters_estimator.ParametersEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.parameters_estimator.ParametersEstimator.compute_parameters_for_node">compute_parameters_for_node() (PyCTBN.parameters_estimator.ParametersEstimator method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.compute_row_delta_in_all_samples_frames">compute_row_delta_in_all_samples_frames() (abstract_importer.AbstractImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.compute_row_delta_in_all_samples_frames">compute_row_delta_in_all_samples_frames() (PyCTBN.abstract_importer.AbstractImporter method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.compute_row_delta_sigle_samples_frame">compute_row_delta_sigle_samples_frame() (abstract_importer.AbstractImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.compute_row_delta_sigle_samples_frame">compute_row_delta_sigle_samples_frame() (PyCTBN.abstract_importer.AbstractImporter method)</a>
</li>
<li><a href="rst/parameters_estimator.html#parameters_estimator.ParametersEstimator.compute_state_res_time_for_node">compute_state_res_time_for_node() (parameters_estimator.ParametersEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.parameters_estimator.ParametersEstimator.compute_state_res_time_for_node">compute_state_res_time_for_node() (PyCTBN.parameters_estimator.ParametersEstimator method)</a>
</li>
<li><a href="rst/parameters_estimator.html#parameters_estimator.ParametersEstimator.compute_state_transitions_for_a_node">compute_state_transitions_for_a_node() (parameters_estimator.ParametersEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.parameters_estimator.ParametersEstimator.compute_state_transitions_for_a_node">compute_state_transitions_for_a_node() (PyCTBN.parameters_estimator.ParametersEstimator method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.concatenated_samples">concatenated_samples() (abstract_importer.AbstractImporter property)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.concatenated_samples">concatenated_samples() (PyCTBN.abstract_importer.AbstractImporter property)</a>
</li>
<li>
conditional_intensity_matrix
<ul>
<li><a href="rst/conditional_intensity_matrix.html#module-conditional_intensity_matrix">module</a>
<li><a href="PyCTBN.html#PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix">ConditionalIntensityMatrix (class in PyCTBN.conditional_intensity_matrix)</a>
</li>
</ul></li>
<li><a href="rst/conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix">ConditionalIntensityMatrix (class in conditional_intensity_matrix)</a>
</li>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.ctpc_algorithm">ctpc_algorithm() (structure_estimator.StructureEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.ctpc_algorithm">ctpc_algorithm() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
</ul></td>
</tr></table>
@ -237,10 +243,10 @@
<h2 id="D">D</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.dataset_id">dataset_id() (abstract_importer.AbstractImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.dataset_id">dataset_id() (PyCTBN.abstract_importer.AbstractImporter method)</a>
<ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.dataset_id">(json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.dataset_id">(PyCTBN.json_importer.JsonImporter method)</a>
</li>
</ul></li>
</ul></td>
@ -249,10 +255,10 @@
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.edges">edges() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.edges">edges() (PyCTBN.network_graph.NetworkGraph property)</a>
<ul>
<li><a href="rst/structure.html#structure.Structure.edges">(structure.Structure property)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.edges">(PyCTBN.structure.Structure property)</a>
</li>
</ul></li>
</ul></td>
@ -261,19 +267,19 @@
<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.fast_init">fast_init() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.fast_init">fast_init() (PyCTBN.network_graph.NetworkGraph method)</a>
<ul>
<li><a href="rst/parameters_estimator.html#parameters_estimator.ParametersEstimator.fast_init">(parameters_estimator.ParametersEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.parameters_estimator.ParametersEstimator.fast_init">(PyCTBN.parameters_estimator.ParametersEstimator method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.file_path">file_path() (abstract_importer.AbstractImporter property)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.file_path">file_path() (PyCTBN.abstract_importer.AbstractImporter property)</a>
</li>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims.filter_cims_with_mask">filter_cims_with_mask() (set_of_cims.SetOfCims method)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims.filter_cims_with_mask">filter_cims_with_mask() (PyCTBN.set_of_cims.SetOfCims method)</a>
</li>
<li><a href="rst/cache.html#cache.Cache.find">find() (cache.Cache method)</a>
<li><a href="PyCTBN.html#PyCTBN.cache.Cache.find">find() (PyCTBN.cache.Cache method)</a>
</li>
</ul></td>
</tr></table>
@ -281,34 +287,34 @@
<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.generate_possible_sub_sets_of_size">generate_possible_sub_sets_of_size() (structure_estimator.StructureEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.generate_possible_sub_sets_of_size">generate_possible_sub_sets_of_size() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims.get_cims_number">get_cims_number() (set_of_cims.SetOfCims method)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims.get_cims_number">get_cims_number() (PyCTBN.set_of_cims.SetOfCims method)</a>
</li>
<li><a href="rst/structure.html#structure.Structure.get_node_id">get_node_id() (structure.Structure method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.get_node_id">get_node_id() (PyCTBN.structure.Structure method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.get_node_indx">get_node_indx() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.get_node_indx">get_node_indx() (PyCTBN.network_graph.NetworkGraph method)</a>
<ul>
<li><a href="rst/structure.html#structure.Structure.get_node_indx">(structure.Structure method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.get_node_indx">(PyCTBN.structure.Structure method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.get_ordered_by_indx_set_of_parents">get_ordered_by_indx_set_of_parents() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.get_ordered_by_indx_set_of_parents">get_ordered_by_indx_set_of_parents() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.get_parents_by_id">get_parents_by_id() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.get_parents_by_id">get_parents_by_id() (PyCTBN.network_graph.NetworkGraph method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.get_positional_node_indx">get_positional_node_indx() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.get_positional_node_indx">get_positional_node_indx() (PyCTBN.network_graph.NetworkGraph method)</a>
<ul>
<li><a href="rst/structure.html#structure.Structure.get_positional_node_indx">(structure.Structure method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.get_positional_node_indx">(PyCTBN.structure.Structure method)</a>
</li>
</ul></li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.get_states_number">get_states_number() (network_graph.NetworkGraph method)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.get_states_number">get_states_number() (PyCTBN.network_graph.NetworkGraph method)</a>
<ul>
<li><a href="rst/structure.html#structure.Structure.get_states_number">(structure.Structure method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.get_states_number">(PyCTBN.structure.Structure method)</a>
</li>
</ul></li>
</ul></td>
@ -317,23 +323,19 @@
<h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.import_data">import_data() (abstract_importer.AbstractImporter method)</a>
<ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.import_data">(json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.import_data">import_data() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
</ul></li>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.import_sampled_cims">import_sampled_cims() (json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.import_sampled_cims">import_sampled_cims() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.import_structure">import_structure() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.import_structure">import_structure() (json_importer.JsonImporter method)</a>
</li>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.import_trajectories">import_trajectories() (json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.import_trajectories">import_trajectories() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.import_variables">import_variables() (json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.import_variables">import_variables() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.independence_test">independence_test() (structure_estimator.StructureEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.independence_test">independence_test() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
</ul></td>
</tr></table>
@ -341,16 +343,7 @@
<h2 id="J">J</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
json_importer
<ul>
<li><a href="rst/json_importer.html#module-json_importer">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter">JsonImporter (class in json_importer)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter">JsonImporter (class in PyCTBN.json_importer)</a>
</li>
</ul></td>
</tr></table>
@ -362,27 +355,29 @@
module
<ul>
<li><a href="rst/abstract_importer.html#module-abstract_importer">abstract_importer</a>
<li><a href="PyCTBN.html#module-PyCTBN">PyCTBN</a>
</li>
<li><a href="rst/cache.html#module-cache">cache</a>
<li><a href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer</a>
</li>
<li><a href="rst/conditional_intensity_matrix.html#module-conditional_intensity_matrix">conditional_intensity_matrix</a>
<li><a href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache</a>
</li>
<li><a href="rst/json_importer.html#module-json_importer">json_importer</a>
<li><a href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix</a>
</li>
<li><a href="rst/network_graph.html#module-network_graph">network_graph</a>
<li><a href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer</a>
</li>
<li><a href="rst/parameters_estimator.html#module-parameters_estimator">parameters_estimator</a>
<li><a href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph</a>
</li>
<li><a href="rst/sample_path.html#module-sample_path">sample_path</a>
<li><a href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator</a>
</li>
<li><a href="rst/set_of_cims.html#module-set_of_cims">set_of_cims</a>
<li><a href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path</a>
</li>
<li><a href="rst/structure.html#module-structure">structure</a>
<li><a href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims</a>
</li>
<li><a href="rst/structure_estimator.html#module-structure_estimator">structure_estimator</a>
<li><a href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure</a>
</li>
<li><a href="rst/trajectory.html#module-trajectory">trajectory</a>
<li><a href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator</a>
</li>
<li><a href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory</a>
</li>
</ul></li>
</ul></td>
@ -391,34 +386,27 @@
<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
network_graph
<ul>
<li><a href="rst/network_graph.html#module-network_graph">module</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph">NetworkGraph (class in PyCTBN.network_graph)</a>
</li>
</ul></li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph">NetworkGraph (class in network_graph)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.nodes">nodes() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.nodes">nodes() (PyCTBN.network_graph.NetworkGraph property)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.nodes_indexes">nodes_indexes() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.nodes_indexes">nodes_indexes() (PyCTBN.network_graph.NetworkGraph property)</a>
<ul>
<li><a href="rst/structure.html#structure.Structure.nodes_indexes">(structure.Structure property)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.nodes_indexes">(PyCTBN.structure.Structure property)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/structure.html#structure.Structure.nodes_labels">nodes_labels() (structure.Structure property)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.nodes_labels">nodes_labels() (PyCTBN.structure.Structure property)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.nodes_values">nodes_values() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.nodes_values">nodes_values() (PyCTBN.network_graph.NetworkGraph property)</a>
<ul>
<li><a href="rst/structure.html#structure.Structure.nodes_values">(structure.Structure property)</a>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.nodes_values">(PyCTBN.structure.Structure property)</a>
</li>
</ul></li>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.normalize_trajectories">normalize_trajectories() (json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.normalize_trajectories">normalize_trajectories() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
</ul></td>
</tr></table>
@ -426,11 +414,11 @@
<h2 id="O">O</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.one_iteration_of_CTPC_algorithm">one_iteration_of_CTPC_algorithm() (structure_estimator.StructureEstimator method)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.one_iteration_of_CTPC_algorithm">one_iteration_of_CTPC_algorithm() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.one_level_normalizing">one_level_normalizing() (json_importer.JsonImporter method)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.one_level_normalizing">one_level_normalizing() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
</ul></td>
</tr></table>
@ -438,127 +426,169 @@
<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.p_combs">p_combs() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.p_combs">p_combs() (PyCTBN.network_graph.NetworkGraph property)</a>
<ul>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims.p_combs">(set_of_cims.SetOfCims property)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims.p_combs">(PyCTBN.set_of_cims.SetOfCims property)</a>
</li>
</ul></li>
<li><a href="PyCTBN.html#PyCTBN.parameters_estimator.ParametersEstimator">ParametersEstimator (class in PyCTBN.parameters_estimator)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.cache.Cache.put">put() (PyCTBN.cache.Cache method)</a>
</li>
<li>
parameters_estimator
PyCTBN
<ul>
<li><a href="rst/parameters_estimator.html#module-parameters_estimator">module</a>
<li><a href="PyCTBN.html#module-PyCTBN">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/parameters_estimator.html#parameters_estimator.ParametersEstimator">ParametersEstimator (class in parameters_estimator)</a>
</li>
<li><a href="rst/cache.html#cache.Cache.put">put() (cache.Cache method)</a>
</li>
</ul></td>
</tr></table>
<li>
PyCTBN.abstract_importer
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/json_importer.html#json_importer.JsonImporter.read_json_file">read_json_file() (json_importer.JsonImporter method)</a>
<ul>
<li><a href="PyCTBN.html#module-PyCTBN.abstract_importer">module</a>
</li>
</ul></td>
</tr></table>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
</ul></li>
<li>
sample_path
PyCTBN.cache
<ul>
<li><a href="rst/sample_path.html#module-sample_path">module</a>
<li><a href="PyCTBN.html#module-PyCTBN.cache">module</a>
</li>
</ul></li>
<li><a href="rst/sample_path.html#sample_path.SamplePath">SamplePath (class in sample_path)</a>
</li>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator.save_results">save_results() (structure_estimator.StructureEstimator method)</a>
</li>
<li>
set_of_cims
PyCTBN.conditional_intensity_matrix
<ul>
<li><a href="rst/set_of_cims.html#module-set_of_cims">module</a>
<li><a href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">module</a>
</li>
</ul></li>
<li><a href="rst/set_of_cims.html#set_of_cims.SetOfCims">SetOfCims (class in set_of_cims)</a>
</li>
<li><a href="rst/trajectory.html#trajectory.Trajectory.size">size() (trajectory.Trajectory method)</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.sorter">sorter() (abstract_importer.AbstractImporter property)</a>
<li>
PyCTBN.json_importer
<ul>
<li><a href="PyCTBN.html#module-PyCTBN.json_importer">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix.state_residence_times">state_residence_times() (conditional_intensity_matrix.ConditionalIntensityMatrix property)</a>
<li>
PyCTBN.network_graph
<ul>
<li><a href="PyCTBN.html#module-PyCTBN.network_graph">module</a>
</li>
<li><a href="rst/conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix.state_transition_matrix">state_transition_matrix() (conditional_intensity_matrix.ConditionalIntensityMatrix property)</a>
</ul></li>
<li>
PyCTBN.parameters_estimator
<ul>
<li><a href="PyCTBN.html#module-PyCTBN.parameters_estimator">module</a>
</li>
</ul></li>
<li>
structure
PyCTBN.sample_path
<ul>
<li><a href="rst/structure.html#module-structure">module</a>
<li><a href="PyCTBN.html#module-PyCTBN.sample_path">module</a>
</li>
</ul></li>
<li><a href="rst/structure.html#structure.Structure">Structure (class in structure)</a>
<li>
PyCTBN.set_of_cims
<ul>
<li><a href="PyCTBN.html#module-PyCTBN.set_of_cims">module</a>
</li>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.structure">structure() (abstract_importer.AbstractImporter property)</a>
</ul></li>
<li>
PyCTBN.structure
<ul>
<li><a href="rst/sample_path.html#sample_path.SamplePath.structure">(sample_path.SamplePath property)</a>
<li><a href="PyCTBN.html#module-PyCTBN.structure">module</a>
</li>
</ul></li>
<li>
structure_estimator
PyCTBN.structure_estimator
<ul>
<li><a href="rst/structure_estimator.html#module-structure_estimator">module</a>
<li><a href="PyCTBN.html#module-PyCTBN.structure_estimator">module</a>
</li>
</ul></li>
<li><a href="rst/structure_estimator.html#structure_estimator.StructureEstimator">StructureEstimator (class in structure_estimator)</a>
<li>
PyCTBN.trajectory
<ul>
<li><a href="PyCTBN.html#module-PyCTBN.trajectory">module</a>
</li>
</ul></li>
</ul></td>
</tr></table>
<h2 id="T">T</h2>
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.time_filtering">time_filtering() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.json_importer.JsonImporter.read_json_file">read_json_file() (PyCTBN.json_importer.JsonImporter method)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.time_scalar_indexing_strucure">time_scalar_indexing_strucure() (network_graph.NetworkGraph property)</a>
</ul></td>
</tr></table>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="PyCTBN.html#PyCTBN.sample_path.SamplePath">SamplePath (class in PyCTBN.sample_path)</a>
</li>
<li><a href="rst/trajectory.html#trajectory.Trajectory.times">times() (trajectory.Trajectory property)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator.save_results">save_results() (PyCTBN.structure_estimator.StructureEstimator method)</a>
</li>
<li><a href="rst/sample_path.html#sample_path.SamplePath.total_variables_count">total_variables_count() (sample_path.SamplePath property)</a>
<li><a href="PyCTBN.html#PyCTBN.set_of_cims.SetOfCims">SetOfCims (class in PyCTBN.set_of_cims)</a>
</li>
<li><a href="rst/structure.html#structure.Structure.total_variables_number">total_variables_number() (structure.Structure property)</a>
<li><a href="PyCTBN.html#PyCTBN.trajectory.Trajectory.size">size() (PyCTBN.trajectory.Trajectory method)</a>
</li>
<li><a href="rst/sample_path.html#sample_path.SamplePath.trajectories">trajectories() (sample_path.SamplePath property)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.sorter">sorter() (PyCTBN.abstract_importer.AbstractImporter property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
trajectory
<li><a href="PyCTBN.html#PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix.state_residence_times">state_residence_times() (PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix.state_transition_matrix">state_transition_matrix() (PyCTBN.conditional_intensity_matrix.ConditionalIntensityMatrix property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure">Structure (class in PyCTBN.structure)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.structure">structure() (PyCTBN.abstract_importer.AbstractImporter property)</a>
<ul>
<li><a href="rst/trajectory.html#module-trajectory">module</a>
<li><a href="PyCTBN.html#PyCTBN.sample_path.SamplePath.structure">(PyCTBN.sample_path.SamplePath property)</a>
</li>
</ul></li>
<li><a href="rst/trajectory.html#trajectory.Trajectory">Trajectory (class in trajectory)</a>
<li><a href="PyCTBN.html#PyCTBN.structure_estimator.StructureEstimator">StructureEstimator (class in PyCTBN.structure_estimator)</a>
</li>
</ul></td>
</tr></table>
<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.time_filtering">time_filtering() (PyCTBN.network_graph.NetworkGraph property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.time_scalar_indexing_strucure">time_scalar_indexing_strucure() (PyCTBN.network_graph.NetworkGraph property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.trajectory.Trajectory.times">times() (PyCTBN.trajectory.Trajectory property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.sample_path.SamplePath.total_variables_count">total_variables_count() (PyCTBN.sample_path.SamplePath property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.structure.Structure.total_variables_number">total_variables_number() (PyCTBN.structure.Structure property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="PyCTBN.html#PyCTBN.sample_path.SamplePath.trajectories">trajectories() (PyCTBN.sample_path.SamplePath property)</a>
</li>
<li><a href="PyCTBN.html#PyCTBN.trajectory.Trajectory">Trajectory (class in PyCTBN.trajectory)</a>
</li>
<li><a href="rst/trajectory.html#trajectory.Trajectory.trajectory">trajectory() (trajectory.Trajectory property)</a>
<li><a href="PyCTBN.html#PyCTBN.trajectory.Trajectory.trajectory">trajectory() (PyCTBN.trajectory.Trajectory property)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.transition_filtering">transition_filtering() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.transition_filtering">transition_filtering() (PyCTBN.network_graph.NetworkGraph property)</a>
</li>
<li><a href="rst/network_graph.html#network_graph.NetworkGraph.transition_scalar_indexing_structure">transition_scalar_indexing_structure() (network_graph.NetworkGraph property)</a>
<li><a href="PyCTBN.html#PyCTBN.network_graph.NetworkGraph.transition_scalar_indexing_structure">transition_scalar_indexing_structure() (PyCTBN.network_graph.NetworkGraph property)</a>
</li>
</ul></td>
</tr></table>
@ -566,7 +596,7 @@
<h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="rst/abstract_importer.html#abstract_importer.AbstractImporter.variables">variables() (abstract_importer.AbstractImporter property)</a>
<li><a href="PyCTBN.html#PyCTBN.abstract_importer.AbstractImporter.variables">variables() (PyCTBN.abstract_importer.AbstractImporter property)</a>
</li>
</ul></td>
</tr></table>
@ -581,7 +611,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
&copy; Copyright 2020, Alessandro Bregoli, Filippo Martini.
</p>
</div>
@ -595,7 +625,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to PyCTBN’s documentation! &mdash; PyCTBN documentation</title>
<title>Welcome to PyCTBN’s documentation! &mdash; PyCTBN 1.0 documentation</title>
@ -26,7 +26,8 @@
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="PyCTBN documentation" href="#"/>
<link rel="top" title="PyCTBN 1.0 documentation" href="#"/>
<link rel="next" title="PyCTBN package" href="PyCTBN.html"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="public" />
@ -58,12 +59,33 @@
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">Welcome to PyCTBN’s documentation!</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN">Module contents</a></li>
</ul>
</div>
</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>
@ -105,6 +127,32 @@
<div class="section" id="welcome-to-pyctbn-s-documentation">
<h1>Welcome to PyCTBN’s documentation!<a class="headerlink" href="#welcome-to-pyctbn-s-documentation" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-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>
</div>
<div class="section" id="indices-and-tables">
@ -120,12 +168,19 @@
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="PyCTBN.html" class="btn btn-neutral float-right" title="PyCTBN package">Next <span class="fa fa-arrow-circle-right"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
&copy; Copyright 2020, Alessandro Bregoli, Filippo Martini.
</p>
</div>
@ -139,7 +194,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -0,0 +1,210 @@
<!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 &mdash; PyCTBN 1.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" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="PyCTBN 1.0 documentation" href="index.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 class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-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">
<div class="section" id="pyctbn">
<h1>PyCTBN<a class="headerlink" href="#pyctbn" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Alessandro Bregoli, Filippo Martini.
</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:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Python Module Index &mdash; PyCTBN documentation</title>
<title>Python Module Index &mdash; PyCTBN 1.0 documentation</title>
@ -26,13 +26,9 @@
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="PyCTBN documentation" href="index.html"/>
<link rel="top" title="PyCTBN 1.0 documentation" href="index.html"/>
<script>
DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
</script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
@ -65,8 +61,33 @@
<!-- Local TOC -->
<div class="local-toc"></div>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-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>
@ -109,91 +130,73 @@
<h1>Python Module Index</h1>
<div class="modindex-jumpbox">
<a href="#cap-a"><strong>a</strong></a> |
<a href="#cap-c"><strong>c</strong></a> |
<a href="#cap-j"><strong>j</strong></a> |
<a href="#cap-n"><strong>n</strong></a> |
<a href="#cap-p"><strong>p</strong></a> |
<a href="#cap-s"><strong>s</strong></a> |
<a href="#cap-t"><strong>t</strong></a>
<a href="#cap-p"><strong>p</strong></a>
</div>
<table class="indextable modindextable">
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-a"><td></td><td>
<strong>a</strong></td><td></td></tr>
<tr class="cap" id="cap-p"><td></td><td>
<strong>p</strong></td><td></td></tr>
<tr>
<td></td>
<td><img src="_static/minus.png" class="toggler"
id="toggle-1" style="display: none" alt="-" /></td>
<td>
<a href="rst/abstract_importer.html#module-abstract_importer"><code class="xref">abstract_importer</code></a></td><td>
<a href="PyCTBN.html#module-PyCTBN"><code class="xref">PyCTBN</code></a></td><td>
<em></em></td></tr>
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-c"><td></td><td>
<strong>c</strong></td><td></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/cache.html#module-cache"><code class="xref">cache</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.abstract_importer"><code class="xref">PyCTBN.abstract_importer</code></a></td><td>
<em></em></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/conditional_intensity_matrix.html#module-conditional_intensity_matrix"><code class="xref">conditional_intensity_matrix</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.cache"><code class="xref">PyCTBN.cache</code></a></td><td>
<em></em></td></tr>
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-j"><td></td><td>
<strong>j</strong></td><td></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/json_importer.html#module-json_importer"><code class="xref">json_importer</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix"><code class="xref">PyCTBN.conditional_intensity_matrix</code></a></td><td>
<em></em></td></tr>
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-n"><td></td><td>
<strong>n</strong></td><td></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/network_graph.html#module-network_graph"><code class="xref">network_graph</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.json_importer"><code class="xref">PyCTBN.json_importer</code></a></td><td>
<em></em></td></tr>
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-p"><td></td><td>
<strong>p</strong></td><td></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/parameters_estimator.html#module-parameters_estimator"><code class="xref">parameters_estimator</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.network_graph"><code class="xref">PyCTBN.network_graph</code></a></td><td>
<em></em></td></tr>
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-s"><td></td><td>
<strong>s</strong></td><td></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/sample_path.html#module-sample_path"><code class="xref">sample_path</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.parameters_estimator"><code class="xref">PyCTBN.parameters_estimator</code></a></td><td>
<em></em></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/set_of_cims.html#module-set_of_cims"><code class="xref">set_of_cims</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.sample_path"><code class="xref">PyCTBN.sample_path</code></a></td><td>
<em></em></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/structure.html#module-structure"><code class="xref">structure</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.set_of_cims"><code class="xref">PyCTBN.set_of_cims</code></a></td><td>
<em></em></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/structure_estimator.html#module-structure_estimator"><code class="xref">structure_estimator</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.structure"><code class="xref">PyCTBN.structure</code></a></td><td>
<em></em></td></tr>
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-t"><td></td><td>
<strong>t</strong></td><td></td></tr>
<tr>
<tr class="cg-1">
<td></td>
<td>
<a href="rst/trajectory.html#module-trajectory"><code class="xref">trajectory</code></a></td><td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.structure_estimator"><code class="xref">PyCTBN.structure_estimator</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="PyCTBN.html#module-PyCTBN.trajectory"><code class="xref">PyCTBN.trajectory</code></a></td><td>
<em></em></td></tr>
</table>
@ -206,7 +209,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
&copy; Copyright 2020, Alessandro Bregoli, Filippo Martini.
</p>
</div>
@ -220,7 +223,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -1,333 +0,0 @@
<!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>abstract_importer module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">abstract_importer module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-abstract_importer">
<span id="abstract-importer-module"></span><h1>abstract_importer module<a class="headerlink" href="#module-abstract_importer" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="abstract_importer.AbstractImporter">
<em class="property">class </em><code class="sig-prename descclassname">abstract_importer.</code><code class="sig-name descname">AbstractImporter</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file_path</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span><a class="headerlink" href="#abstract_importer.AbstractImporter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
<p>Abstract class that exposes all the necessary methods to process the trajectories and the net structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>file_path</strong> (<em>str</em>) – the file path</p>
</dd>
<dt class="field-even">_concatenated_samples</dt>
<dd class="field-even"><p>Dataframe containing the concatenation of all the processed trajectories</p>
</dd>
<dt class="field-odd">_df_structure</dt>
<dd class="field-odd"><p>Dataframe containing the structure of the network (edges)</p>
</dd>
<dt class="field-even">_df_variables</dt>
<dd class="field-even"><p>Dataframe containing the nodes cardinalities</p>
</dd>
<dt class="field-odd">_sorter</dt>
<dd class="field-odd"><p>A list containing the columns header (excluding the time column) of the <cite>_concatenated_samples</cite></p>
</dd>
</dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.build_list_of_samples_array">
<code class="sig-name descname">build_list_of_samples_array</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data_frame</span><span class="p">:</span> <span class="n">pandas.core.frame.DataFrame</span></em><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#abstract_importer.AbstractImporter.build_list_of_samples_array" title="Permalink to this definition"></a></dt>
<dd><p>Builds a List containing the columns of data_frame and converts them to a numpy array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data_frame</strong> (<em>pandas.Dataframe</em>) – the dataframe from which the columns have to be extracted and converted</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the resulting list of numpy arrays</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>List</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.build_sorter">
<em class="property">abstract </em><code class="sig-name descname">build_sorter</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sample_frame</span><span class="p">:</span> <span class="n">pandas.core.frame.DataFrame</span></em><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#abstract_importer.AbstractImporter.build_sorter" title="Permalink to this definition"></a></dt>
<dd><p>Initializes the <code class="docutils literal notranslate"><span class="pre">_sorter</span></code> class member from a trajectory dataframe, exctracting the header of the frame
and keeping ONLY the variables symbolic labels, cutting out the time label in the header.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>sample_frame</strong> (<em>pandas.DataFrame</em>) – The dataframe from which extract the header</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list containing the processed header.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>List</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.clear_concatenated_frame">
<code class="sig-name descname">clear_concatenated_frame</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#abstract_importer.AbstractImporter.clear_concatenated_frame" title="Permalink to this definition"></a></dt>
<dd><p>Removes all values in the dataframe concatenated_samples.</p>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.compute_row_delta_in_all_samples_frames">
<code class="sig-name descname">compute_row_delta_in_all_samples_frames</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">df_samples_list</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#abstract_importer.AbstractImporter.compute_row_delta_in_all_samples_frames" title="Permalink to this definition"></a></dt>
<dd><p>Calls the method <code class="docutils literal notranslate"><span class="pre">compute_row_delta_sigle_samples_frame</span></code> on every dataframe present in the list
<code class="docutils literal notranslate"><span class="pre">df_samples_list</span></code>.
Concatenates the result in the dataframe <code class="docutils literal notranslate"><span class="pre">concatanated_samples</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>df_samples_list</strong> (<em>List</em>) – the datframe’s list to be processed and concatenated</p>
</dd>
</dl>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The Dataframe sample_frame has to follow the column structure of this header:
Header of sample_frame = [Time | Variable values]
The class member self._sorter HAS to be properly INITIALIZED (See class members definition doc)</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>After the call of this method the class member <code class="docutils literal notranslate"><span class="pre">concatanated_samples</span></code> will contain all processed
and merged trajectories</p>
</div>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.compute_row_delta_sigle_samples_frame">
<code class="sig-name descname">compute_row_delta_sigle_samples_frame</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sample_frame</span><span class="p">:</span> <span class="n">pandas.core.frame.DataFrame</span></em>, <em class="sig-param"><span class="n">columns_header</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">shifted_cols_header</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; pandas.core.frame.DataFrame<a class="headerlink" href="#abstract_importer.AbstractImporter.compute_row_delta_sigle_samples_frame" title="Permalink to this definition"></a></dt>
<dd><p>Computes the difference between each value present in th time column.
Copies and shift by one position up all the values present in the remaining columns.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sample_frame</strong> (<em>pandas.Dataframe</em>) – the traj to be processed</p></li>
<li><p><strong>columns_header</strong> (<em>List</em>) – the original header of sample_frame</p></li>
<li><p><strong>shifted_cols_header</strong> (<em>List</em>) – a copy of columns_header with changed names of the contents</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The processed dataframe</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pandas.Dataframe</p>
</dd>
</dl>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>the Dataframe <code class="docutils literal notranslate"><span class="pre">sample_frame</span></code> has to follow the column structure of this header:
Header of sample_frame = [Time | Variable values]</p>
</div>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.concatenated_samples">
<em class="property">property </em><code class="sig-name descname">concatenated_samples</code><a class="headerlink" href="#abstract_importer.AbstractImporter.concatenated_samples" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.dataset_id">
<em class="property">abstract </em><code class="sig-name descname">dataset_id</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; object<a class="headerlink" href="#abstract_importer.AbstractImporter.dataset_id" title="Permalink to this definition"></a></dt>
<dd><p>If the original dataset contains multiple dataset, this method returns a unique id to identify the current
dataset</p>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.file_path">
<em class="property">property </em><code class="sig-name descname">file_path</code><a class="headerlink" href="#abstract_importer.AbstractImporter.file_path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.import_data">
<em class="property">abstract </em><code class="sig-name descname">import_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#abstract_importer.AbstractImporter.import_data" title="Permalink to this definition"></a></dt>
<dd><p>Imports all the trajectories, variables cardinalities, and net edges.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The class members <code class="docutils literal notranslate"><span class="pre">_df_variables</span></code> and <code class="docutils literal notranslate"><span class="pre">_df_structure</span></code> HAVE to be properly constructed
as Pandas Dataframes with the following structure:
Header of _df_structure = [From_Node | To_Node]
Header of _df_variables = [Variable_Label | Variable_Cardinality]</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>See :class:<code class="docutils literal notranslate"><span class="pre">JsonImporter</span></code> for an example of implementation of this method.</p>
</div>
</dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.sorter">
<em class="property">property </em><code class="sig-name descname">sorter</code><a class="headerlink" href="#abstract_importer.AbstractImporter.sorter" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.structure">
<em class="property">property </em><code class="sig-name descname">structure</code><a class="headerlink" href="#abstract_importer.AbstractImporter.structure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="abstract_importer.AbstractImporter.variables">
<em class="property">property </em><code class="sig-name descname">variables</code><a class="headerlink" href="#abstract_importer.AbstractImporter.variables" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,224 +0,0 @@
<!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>cache module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">cache module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-cache">
<span id="cache-module"></span><h1>cache module<a class="headerlink" href="#module-cache" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="cache.Cache">
<em class="property">class </em><code class="sig-prename descclassname">cache.</code><code class="sig-name descname">Cache</code><a class="headerlink" href="#cache.Cache" 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>This class acts as a cache of <code class="docutils literal notranslate"><span class="pre">SetOfCims</span></code> objects for a node.</p>
<dl class="field-list simple">
<dt class="field-odd">_list_of_sets_of_parents</dt>
<dd class="field-odd"><p>a list of <code class="docutils literal notranslate"><span class="pre">Sets</span></code> objects of the parents to which the cim in cache at SAME
index is related</p>
</dd>
<dt class="field-even">_actual_cache</dt>
<dd class="field-even"><p>a list of setOfCims objects</p>
</dd>
</dl>
<dl class="py method">
<dt id="cache.Cache.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cache.Cache.clear" title="Permalink to this definition"></a></dt>
<dd><p>Clear the contents both of <code class="docutils literal notranslate"><span class="pre">_actual_cache</span></code> and <code class="docutils literal notranslate"><span class="pre">_list_of_sets_of_parents</span></code>.</p>
</dd></dl>
<dl class="py method">
<dt id="cache.Cache.find">
<code class="sig-name descname">find</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parents_comb</span><span class="p">:</span> <span class="n">Set</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="set_of_cims.html#set_of_cims.SetOfCims" title="set_of_cims.SetOfCims">set_of_cims.SetOfCims</a><a class="headerlink" href="#cache.Cache.find" title="Permalink to this definition"></a></dt>
<dd><p>Tries to find in cache given the symbolic parents combination <code class="docutils literal notranslate"><span class="pre">parents_comb</span></code> the <code class="docutils literal notranslate"><span class="pre">SetOfCims</span></code>
related to that <code class="docutils literal notranslate"><span class="pre">parents_comb</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>parents_comb</strong> (<em>Set</em>) – the parents related to that <code class="docutils literal notranslate"><span class="pre">SetOfCims</span></code></p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A <code class="docutils literal notranslate"><span class="pre">SetOfCims</span></code> object if the <code class="docutils literal notranslate"><span class="pre">parents_comb</span></code> index is found in <code class="docutils literal notranslate"><span class="pre">_list_of_sets_of_parents</span></code>.
None otherwise.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="set_of_cims.html#set_of_cims.SetOfCims" title="set_of_cims.SetOfCims">SetOfCims</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="cache.Cache.put">
<code class="sig-name descname">put</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parents_comb</span><span class="p">:</span> <span class="n">Set</span></em>, <em class="sig-param"><span class="n">socim</span><span class="p">:</span> <span class="n"><a class="reference internal" href="set_of_cims.html#set_of_cims.SetOfCims" title="set_of_cims.SetOfCims">set_of_cims.SetOfCims</a></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cache.Cache.put" title="Permalink to this definition"></a></dt>
<dd><p>Place in cache the <code class="docutils literal notranslate"><span class="pre">SetOfCims</span></code> object, and the related symbolic index <code class="docutils literal notranslate"><span class="pre">parents_comb</span></code> in
<code class="docutils literal notranslate"><span class="pre">_list_of_sets_of_parents</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>parents_comb</strong> (<em>Set</em>) – the symbolic set index</p></li>
<li><p><strong>socim</strong> (<a class="reference internal" href="set_of_cims.html#set_of_cims.SetOfCims" title="set_of_cims.SetOfCims"><em>SetOfCims</em></a>) – the related SetOfCims object</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,209 +0,0 @@
<!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>conditional_intensity_matrix module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">conditional_intensity_matrix module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-conditional_intensity_matrix">
<span id="conditional-intensity-matrix-module"></span><h1>conditional_intensity_matrix module<a class="headerlink" href="#module-conditional_intensity_matrix" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="conditional_intensity_matrix.ConditionalIntensityMatrix">
<em class="property">class </em><code class="sig-prename descclassname">conditional_intensity_matrix.</code><code class="sig-name descname">ConditionalIntensityMatrix</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">state_residence_times</span><span class="p">:</span> <span class="n">numpy.array</span></em>, <em class="sig-param"><span class="n">state_transition_matrix</span><span class="p">:</span> <span class="n">numpy.array</span></em><span class="sig-paren">)</span><a class="headerlink" href="#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>
<dl class="py method">
<dt id="conditional_intensity_matrix.ConditionalIntensityMatrix.cim">
<em class="property">property </em><code class="sig-name descname">cim</code><a class="headerlink" href="#conditional_intensity_matrix.ConditionalIntensityMatrix.cim" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="conditional_intensity_matrix.ConditionalIntensityMatrix.compute_cim_coefficients">
<code class="sig-name descname">compute_cim_coefficients</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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>
<dl class="py method">
<dt id="conditional_intensity_matrix.ConditionalIntensityMatrix.state_residence_times">
<em class="property">property </em><code class="sig-name descname">state_residence_times</code><a class="headerlink" href="#conditional_intensity_matrix.ConditionalIntensityMatrix.state_residence_times" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="conditional_intensity_matrix.ConditionalIntensityMatrix.state_transition_matrix">
<em class="property">property </em><code class="sig-name descname">state_transition_matrix</code><a class="headerlink" href="#conditional_intensity_matrix.ConditionalIntensityMatrix.state_transition_matrix" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,353 +0,0 @@
<!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>json_importer module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">json_importer module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-json_importer">
<span id="json-importer-module"></span><h1>json_importer module<a class="headerlink" href="#module-json_importer" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="json_importer.JsonImporter">
<em class="property">class </em><code class="sig-prename descclassname">json_importer.</code><code class="sig-name descname">JsonImporter</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file_path</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">samples_label</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">structure_label</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">variables_label</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">time_key</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">variables_key</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">array_indx</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span><a class="headerlink" href="#json_importer.JsonImporter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="abstract_importer.html#abstract_importer.AbstractImporter" title="abstract_importer.AbstractImporter"><code class="xref py py-class docutils literal notranslate"><span class="pre">abstract_importer.AbstractImporter</span></code></a></p>
<p>Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare the data in json ext.
with the following structure:
[0]</p>
<blockquote>
<div><p><a href="#id1"><span class="problematic" id="id2">|</span></a>_ dyn.cims
<a href="#id3"><span class="problematic" id="id4">|</span></a>_ dyn.str
<a href="#id5"><span class="problematic" id="id6">|</span></a>_ samples
<a href="#id7"><span class="problematic" id="id8">|</span></a>_ variabels</p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file_path</strong> (<em>string</em>) – the path of the file that contains tha data to be imported</p></li>
<li><p><strong>samples_label</strong> (<em>string</em>) – the reference key for the samples in the trajectories</p></li>
<li><p><strong>structure_label</strong> (<em>string</em>) – the reference key for the structure of the network data</p></li>
<li><p><strong>variables_label</strong> (<em>string</em>) – the reference key for the cardinalites of the nodes data</p></li>
<li><p><strong>time_key</strong> (<em>string</em>) – the key used to identify the timestamps in each trajectory</p></li>
<li><p><strong>variables_key</strong> (<em>string</em>) – the key used to identify the names of the variables in the net</p></li>
<li><p><strong>array_indx</strong> (<em>int</em>) – the index of the outer JsonArray to exctract the data from</p></li>
</ul>
</dd>
<dt class="field-even">_df_samples_list</dt>
<dd class="field-even"><p>a Dataframe list in which every dataframe contains a trajectory</p>
</dd>
</dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.build_sorter">
<code class="sig-name descname">build_sorter</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sample_frame</span><span class="p">:</span> <span class="n">pandas.core.frame.DataFrame</span></em><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#json_importer.JsonImporter.build_sorter" title="Permalink to this definition"></a></dt>
<dd><p>Implements the abstract method build_sorter of the <code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractImporter</span></code> for this dataset</p>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.clear_data_frame_list">
<code class="sig-name descname">clear_data_frame_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#json_importer.JsonImporter.clear_data_frame_list" title="Permalink to this definition"></a></dt>
<dd><p>Removes all values present in the dataframes in the list <code class="docutils literal notranslate"><span class="pre">_df_samples_list</span></code>.</p>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.dataset_id">
<code class="sig-name descname">dataset_id</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; object<a class="headerlink" href="#json_importer.JsonImporter.dataset_id" title="Permalink to this definition"></a></dt>
<dd><p>If the original dataset contains multiple dataset, this method returns a unique id to identify the current
dataset</p>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.import_data">
<code class="sig-name descname">import_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#json_importer.JsonImporter.import_data" title="Permalink to this definition"></a></dt>
<dd><p>Implements the abstract method of <code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractImporter</span></code></p>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.import_sampled_cims">
<code class="sig-name descname">import_sampled_cims</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raw_data</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">cims_key</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; Dict<a class="headerlink" href="#json_importer.JsonImporter.import_sampled_cims" title="Permalink to this definition"></a></dt>
<dd><p>Imports the synthetic CIMS in the dataset in a dictionary, using variables labels
as keys for the set of CIMS of a particular node.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>raw_data</strong> (<em>List</em>) – List of Dicts</p></li>
<li><p><strong>indx</strong> (<em>int</em>) – The index of the array from which the data have to be extracted</p></li>
<li><p><strong>cims_key</strong> (<em>string</em>) – the key where the json object cims are placed</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a dictionary containing the sampled CIMS for all the variables in the net</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Dictionary</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.import_structure">
<code class="sig-name descname">import_structure</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raw_data</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; pandas.core.frame.DataFrame<a class="headerlink" href="#json_importer.JsonImporter.import_structure" title="Permalink to this definition"></a></dt>
<dd><p>Imports in a dataframe the data in the list raw_data at the key <code class="docutils literal notranslate"><span class="pre">_structure_label</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>raw_data</strong> (<em>List</em>) – List of Dicts</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Dataframe containg the starting node a ending node of every arc of the network</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pandas.Dataframe</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.import_trajectories">
<code class="sig-name descname">import_trajectories</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raw_data</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#json_importer.JsonImporter.import_trajectories" title="Permalink to this definition"></a></dt>
<dd><p>Imports the trajectories from the list of dicts <code class="docutils literal notranslate"><span class="pre">raw_data</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>raw_data</strong> (<em>List</em>) – List of Dicts</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of dataframes containing all the trajectories</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>List</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.import_variables">
<code class="sig-name descname">import_variables</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raw_data</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; pandas.core.frame.DataFrame<a class="headerlink" href="#json_importer.JsonImporter.import_variables" title="Permalink to this definition"></a></dt>
<dd><p>Imports the data in <code class="docutils literal notranslate"><span class="pre">raw_data</span></code> at the key <code class="docutils literal notranslate"><span class="pre">_variables_label</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>raw_data</strong> (<em>List</em>) – List of Dicts</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Datframe containg the variables simbolic labels and their cardinalities</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pandas.Dataframe</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.normalize_trajectories">
<code class="sig-name descname">normalize_trajectories</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raw_data</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">trajectories_key</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#json_importer.JsonImporter.normalize_trajectories" title="Permalink to this definition"></a></dt>
<dd><p>Extracts the trajectories in <code class="docutils literal notranslate"><span class="pre">raw_data</span></code> at the index <code class="docutils literal notranslate"><span class="pre">index</span></code> at the key <code class="docutils literal notranslate"><span class="pre">trajectories</span> <span class="pre">key</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>raw_data</strong> (<em>List</em>) – List of Dicts</p></li>
<li><p><strong>indx</strong> (<em>int</em>) – The index of the array from which the data have to be extracted</p></li>
<li><p><strong>trajectories_key</strong> (<em>string</em>) – the key of the trajectories objects</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of daframes containg the trajectories</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>List</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.one_level_normalizing">
<code class="sig-name descname">one_level_normalizing</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">raw_data</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; pandas.core.frame.DataFrame<a class="headerlink" href="#json_importer.JsonImporter.one_level_normalizing" title="Permalink to this definition"></a></dt>
<dd><p>Extracts the one-level nested data in the list <code class="docutils literal notranslate"><span class="pre">raw_data</span></code> at the index <code class="docutils literal notranslate"><span class="pre">indx</span></code> at the key <code class="docutils literal notranslate"><span class="pre">key</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>raw_data</strong> (<em>List</em>) – List of Dicts</p></li>
<li><p><strong>indx</strong> (<em>int</em>) – The index of the array from which the data have to be extracted</p></li>
<li><p><strong>key</strong> (<em>string</em>) – the key for the Dicts from which exctract data</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A normalized dataframe</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pandas.Datframe</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="json_importer.JsonImporter.read_json_file">
<code class="sig-name descname">read_json_file</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#json_importer.JsonImporter.read_json_file" title="Permalink to this definition"></a></dt>
<dd><p>Reads the JSON file in the path self.filePath</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The contents of the json file</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>List</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,183 +0,0 @@
<!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>scripts &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">scripts</a></li>
</ul>
</div>
</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">
<div class="section" id="scripts">
<h1>scripts<a class="headerlink" href="#scripts" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="abstract_importer.html">abstract_importer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="cache.html">cache module</a></li>
<li class="toctree-l1"><a class="reference internal" href="conditional_intensity_matrix.html">conditional_intensity_matrix module</a></li>
<li class="toctree-l1"><a class="reference internal" href="json_importer.html">json_importer module</a></li>
<li class="toctree-l1"><a class="reference internal" href="network_graph.html">network_graph module</a></li>
<li class="toctree-l1"><a class="reference internal" href="parameters_estimator.html">parameters_estimator module</a></li>
<li class="toctree-l1"><a class="reference internal" href="sample_path.html">sample_path module</a></li>
<li class="toctree-l1"><a class="reference internal" href="set_of_cims.html">set_of_cims module</a></li>
<li class="toctree-l1"><a class="reference internal" href="structure.html">structure module</a></li>
<li class="toctree-l1"><a class="reference internal" href="structure_estimator.html">structure_estimator module</a></li>
<li class="toctree-l1"><a class="reference internal" href="trajectory.html">trajectory module</a></li>
</ul>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,420 +0,0 @@
<!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>network_graph module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">network_graph module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-network_graph">
<span id="network-graph-module"></span><h1>network_graph module<a class="headerlink" href="#module-network_graph" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="network_graph.NetworkGraph">
<em class="property">class </em><code class="sig-prename descclassname">network_graph.</code><code class="sig-name descname">NetworkGraph</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">graph_struct</span><span class="p">:</span> <span class="n"><a class="reference internal" href="structure.html#structure.Structure" title="structure.Structure">structure.Structure</a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#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="structure.html#structure.Structure" title="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">
<dt id="network_graph.NetworkGraph.add_edges">
<code class="sig-name descname">add_edges</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">list_of_edges</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.add_nodes">
<code class="sig-name descname">add_nodes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">list_of_nodes</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.build_p_comb_structure_for_a_node">
<code class="sig-name descname">build_p_comb_structure_for_a_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parents_values</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.build_time_columns_filtering_for_a_node">
<code class="sig-name descname">build_time_columns_filtering_for_a_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">p_indxs</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.build_time_scalar_indexing_structure_for_a_node">
<code class="sig-name descname">build_time_scalar_indexing_structure_for_a_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">parents_vals</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#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_id</strong> (<em>string</em>) – the node label</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">
<dt id="network_graph.NetworkGraph.build_transition_filtering_for_a_node">
<code class="sig-name descname">build_transition_filtering_for_a_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">p_indxs</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#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
:return: The filtering structure for transitions estimation
:rtype: numpy.ndArray</p>
</dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.build_transition_scalar_indexing_structure_for_a_node">
<code class="sig-name descname">build_transition_scalar_indexing_structure_for_a_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">parents_vals</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#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_id</strong> (<em>string</em>) – the node label</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">
<dt id="network_graph.NetworkGraph.edges">
<em class="property">property </em><code class="sig-name descname">edges</code><a class="headerlink" href="#network_graph.NetworkGraph.edges" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.fast_init">
<code class="sig-name descname">fast_init</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.get_node_indx">
<code class="sig-name descname">get_node_indx</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#network_graph.NetworkGraph.get_node_indx" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.get_ordered_by_indx_set_of_parents">
<code class="sig-name descname">get_ordered_by_indx_set_of_parents</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; Tuple<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.get_parents_by_id">
<code class="sig-name descname">get_parents_by_id</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span></em><span class="sig-paren">)</span> &#x2192; List<a class="headerlink" href="#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">
<dt id="network_graph.NetworkGraph.get_positional_node_indx">
<code class="sig-name descname">get_positional_node_indx</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#network_graph.NetworkGraph.get_positional_node_indx" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.get_states_number">
<code class="sig-name descname">get_states_number</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#network_graph.NetworkGraph.get_states_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.nodes">
<em class="property">property </em><code class="sig-name descname">nodes</code><a class="headerlink" href="#network_graph.NetworkGraph.nodes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.nodes_indexes">
<em class="property">property </em><code class="sig-name descname">nodes_indexes</code><a class="headerlink" href="#network_graph.NetworkGraph.nodes_indexes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.nodes_values">
<em class="property">property </em><code class="sig-name descname">nodes_values</code><a class="headerlink" href="#network_graph.NetworkGraph.nodes_values" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.p_combs">
<em class="property">property </em><code class="sig-name descname">p_combs</code><a class="headerlink" href="#network_graph.NetworkGraph.p_combs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.time_filtering">
<em class="property">property </em><code class="sig-name descname">time_filtering</code><a class="headerlink" href="#network_graph.NetworkGraph.time_filtering" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.time_scalar_indexing_strucure">
<em class="property">property </em><code class="sig-name descname">time_scalar_indexing_strucure</code><a class="headerlink" href="#network_graph.NetworkGraph.time_scalar_indexing_strucure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.transition_filtering">
<em class="property">property </em><code class="sig-name descname">transition_filtering</code><a class="headerlink" href="#network_graph.NetworkGraph.transition_filtering" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="network_graph.NetworkGraph.transition_scalar_indexing_structure">
<em class="property">property </em><code class="sig-name descname">transition_scalar_indexing_structure</code><a class="headerlink" href="#network_graph.NetworkGraph.transition_scalar_indexing_structure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,250 +0,0 @@
<!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>parameters_estimator module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">parameters_estimator module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-parameters_estimator">
<span id="parameters-estimator-module"></span><h1>parameters_estimator module<a class="headerlink" href="#module-parameters_estimator" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="parameters_estimator.ParametersEstimator">
<em class="property">class </em><code class="sig-prename descclassname">parameters_estimator.</code><code class="sig-name descname">ParametersEstimator</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trajectories</span><span class="p">:</span> <span class="n"><a class="reference internal" href="trajectory.html#trajectory.Trajectory" title="trajectory.Trajectory">trajectory.Trajectory</a></span></em>, <em class="sig-param"><span class="n">net_graph</span><span class="p">:</span> <span class="n"><a class="reference internal" href="network_graph.html#network_graph.NetworkGraph" title="network_graph.NetworkGraph">network_graph.NetworkGraph</a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#parameters_estimator.ParametersEstimator" 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>Has the task of computing the cims of particular node given the trajectories and the net structure
in the graph <code class="docutils literal notranslate"><span class="pre">_net_graph</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>trajectories</strong> (<a class="reference internal" href="trajectory.html#trajectory.Trajectory" title="trajectory.Trajectory"><em>Trajectory</em></a>) – the trajectories</p></li>
<li><p><strong>net_graph</strong> (<a class="reference internal" href="network_graph.html#network_graph.NetworkGraph" title="network_graph.NetworkGraph"><em>NetworkGraph</em></a>) – the net structure</p></li>
</ul>
</dd>
<dt class="field-even">_single_set_of_cims</dt>
<dd class="field-even"><p>the set of cims object that will hold the cims of the node</p>
</dd>
</dl>
<dl class="py method">
<dt id="parameters_estimator.ParametersEstimator.compute_parameters_for_node">
<code class="sig-name descname">compute_parameters_for_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="set_of_cims.html#set_of_cims.SetOfCims" title="set_of_cims.SetOfCims">set_of_cims.SetOfCims</a><a class="headerlink" href="#parameters_estimator.ParametersEstimator.compute_parameters_for_node" title="Permalink to this definition"></a></dt>
<dd><p>Compute the CIMS of the node identified by the label <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 SetOfCims object filled with the computed CIMS</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="set_of_cims.html#set_of_cims.SetOfCims" title="set_of_cims.SetOfCims">SetOfCims</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="parameters_estimator.ParametersEstimator.compute_state_res_time_for_node">
<code class="sig-name descname">compute_state_res_time_for_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">times</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">trajectory</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">cols_filter</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">scalar_indexes_struct</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">T</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#parameters_estimator.ParametersEstimator.compute_state_res_time_for_node" title="Permalink to this definition"></a></dt>
<dd><p>Compute the state residence times for a node and fill the matrix <code class="docutils literal notranslate"><span class="pre">T</span></code> with the results</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="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>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="parameters_estimator.ParametersEstimator.compute_state_transitions_for_a_node">
<code class="sig-name descname">compute_state_transitions_for_a_node</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_indx</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">trajectory</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">cols_filter</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">scalar_indexing</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">M</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span><a class="headerlink" href="#parameters_estimator.ParametersEstimator.compute_state_transitions_for_a_node" title="Permalink to this definition"></a></dt>
<dd><p>Compute the state residence times for a node and fill the matrices <code class="docutils literal notranslate"><span class="pre">M</span></code> with the results.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="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>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="parameters_estimator.ParametersEstimator.fast_init">
<code class="sig-name descname">fast_init</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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 <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>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,219 +0,0 @@
<!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>sample_path module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">sample_path module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-sample_path">
<span id="sample-path-module"></span><h1>sample_path module<a class="headerlink" href="#module-sample_path" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="sample_path.SamplePath">
<em class="property">class </em><code class="sig-prename descclassname">sample_path.</code><code class="sig-name descname">SamplePath</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">importer</span><span class="p">:</span> <span class="n"><a class="reference internal" href="abstract_importer.html#abstract_importer.AbstractImporter" title="abstract_importer.AbstractImporter">abstract_importer.AbstractImporter</a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#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="abstract_importer.html#abstract_importer.AbstractImporter" title="abstract_importer.AbstractImporter"><em>AbstractImporter</em></a>) – the Importer objects that will import ad process 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 structurral 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">
<dt id="sample_path.SamplePath.build_structure">
<code class="sig-name descname">build_structure</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="sample_path.SamplePath.build_trajectories">
<code class="sig-name descname">build_trajectories</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="sample_path.SamplePath.structure">
<em class="property">property </em><code class="sig-name descname">structure</code><a class="headerlink" href="#sample_path.SamplePath.structure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="sample_path.SamplePath.total_variables_count">
<em class="property">property </em><code class="sig-name descname">total_variables_count</code><a class="headerlink" href="#sample_path.SamplePath.total_variables_count" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="sample_path.SamplePath.trajectories">
<em class="property">property </em><code class="sig-name descname">trajectories</code><a class="headerlink" href="#sample_path.SamplePath.trajectories" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,251 +0,0 @@
<!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>set_of_cims module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">set_of_cims module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-set_of_cims">
<span id="set-of-cims-module"></span><h1>set_of_cims module<a class="headerlink" href="#module-set_of_cims" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="set_of_cims.SetOfCims">
<em class="property">class </em><code class="sig-prename descclassname">set_of_cims.</code><code class="sig-name descname">SetOfCims</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">parents_states_number</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">node_states_number</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">p_combs</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span><a class="headerlink" href="#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>
<dl class="py method">
<dt id="set_of_cims.SetOfCims.actual_cims">
<em class="property">property </em><code class="sig-name descname">actual_cims</code><a class="headerlink" href="#set_of_cims.SetOfCims.actual_cims" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="set_of_cims.SetOfCims.build_cims">
<code class="sig-name descname">build_cims</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">state_res_times</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">transition_matrices</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="set_of_cims.SetOfCims.build_times_and_transitions_structures">
<code class="sig-name descname">build_times_and_transitions_structures</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#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">
<dt id="set_of_cims.SetOfCims.filter_cims_with_mask">
<code class="sig-name descname">filter_cims_with_mask</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mask_arr</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">comb</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#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">
<dt id="set_of_cims.SetOfCims.get_cims_number">
<code class="sig-name descname">get_cims_number</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#set_of_cims.SetOfCims.get_cims_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="set_of_cims.SetOfCims.p_combs">
<em class="property">property </em><code class="sig-name descname">p_combs</code><a class="headerlink" href="#set_of_cims.SetOfCims.p_combs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,267 +0,0 @@
<!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>structure module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">structure module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-structure">
<span id="structure-module"></span><h1>structure module<a class="headerlink" href="#module-structure" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="structure.Structure">
<em class="property">class </em><code class="sig-prename descclassname">structure.</code><code class="sig-name descname">Structure</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">nodes_labels_list</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">nodes_indexes_arr</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">nodes_vals_arr</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">edges_list</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">total_variables_number</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span><a class="headerlink" href="#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 net</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="structure.Structure.edges">
<em class="property">property </em><code class="sig-name descname">edges</code><a class="headerlink" href="#structure.Structure.edges" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="structure.Structure.get_node_id">
<code class="sig-name descname">get_node_id</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_indx</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; str<a class="headerlink" href="#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">
<dt id="structure.Structure.get_node_indx">
<code class="sig-name descname">get_node_indx</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#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">
<dt id="structure.Structure.get_positional_node_indx">
<code class="sig-name descname">get_positional_node_indx</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#structure.Structure.get_positional_node_indx" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="structure.Structure.get_states_number">
<code class="sig-name descname">get_states_number</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#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>
<dl class="py method">
<dt id="structure.Structure.nodes_indexes">
<em class="property">property </em><code class="sig-name descname">nodes_indexes</code><a class="headerlink" href="#structure.Structure.nodes_indexes" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="structure.Structure.nodes_labels">
<em class="property">property </em><code class="sig-name descname">nodes_labels</code><a class="headerlink" href="#structure.Structure.nodes_labels" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="structure.Structure.nodes_values">
<em class="property">property </em><code class="sig-name descname">nodes_values</code><a class="headerlink" href="#structure.Structure.nodes_values" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="structure.Structure.total_variables_number">
<em class="property">property </em><code class="sig-name descname">total_variables_number</code><a class="headerlink" href="#structure.Structure.total_variables_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,309 +0,0 @@
<!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>structure_estimator module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">structure_estimator module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-structure_estimator">
<span id="structure-estimator-module"></span><h1>structure_estimator module<a class="headerlink" href="#module-structure_estimator" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="structure_estimator.StructureEstimator">
<em class="property">class </em><code class="sig-prename descclassname">structure_estimator.</code><code class="sig-name descname">StructureEstimator</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sample_path</span><span class="p">:</span> <span class="n"><a class="reference internal" href="sample_path.html#sample_path.SamplePath" title="sample_path.SamplePath">sample_path.SamplePath</a></span></em>, <em class="sig-param"><span class="n">exp_test_alfa</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">chi_test_alfa</span><span class="p">:</span> <span class="n">float</span></em><span class="sig-paren">)</span><a class="headerlink" href="#structure_estimator.StructureEstimator" 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>Has the task of estimating the network structure given the trajectories in <code class="docutils literal notranslate"><span class="pre">samplepath</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sample_path</strong> (<a class="reference internal" href="sample_path.html#sample_path.SamplePath" title="sample_path.SamplePath"><em>SamplePath</em></a>) – the _sample_path object containing the trajectories and the real structure</p></li>
<li><p><strong>exp_test_alfa</strong> (<em>float</em>) – the significance level for the exponential Hp test</p></li>
<li><p><strong>chi_test_alfa</strong> (<em>float</em>) – the significance level for the chi Hp test</p></li>
</ul>
</dd>
<dt class="field-even">_nodes</dt>
<dd class="field-even"><p>the nodes labels</p>
</dd>
<dt class="field-odd">_nodes_vals</dt>
<dd class="field-odd"><p>the nodes cardinalities</p>
</dd>
<dt class="field-even">_nodes_indxs</dt>
<dd class="field-even"><p>the nodes indexes</p>
</dd>
<dt class="field-odd">_complete_graph</dt>
<dd class="field-odd"><p>the complete directed graph built using the nodes labels in <code class="docutils literal notranslate"><span class="pre">_nodes</span></code></p>
</dd>
<dt class="field-even">_cache</dt>
<dd class="field-even"><p>the Cache object</p>
</dd>
</dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.build_complete_graph">
<code class="sig-name descname">build_complete_graph</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_ids</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> &#x2192; networkx.classes.digraph.DiGraph<a class="headerlink" href="#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 <code class="docutils literal notranslate"><span class="pre">node_ids</span></code>:</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>node_ids</strong> (<em>List</em>) – the list of nodes labels</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a complete Digraph Object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>networkx.DiGraph</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.complete_test">
<code class="sig-name descname">complete_test</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">test_parent</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">test_child</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">parent_set</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">child_states_numb</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">tot_vars_count</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#structure_estimator.StructureEstimator.complete_test" title="Permalink to this definition"></a></dt>
<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>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="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 <code class="docutils literal notranslate"><span class="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>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True iff test_child and test_parent are independent given the sep_set parent_set. False otherwise</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.ctpc_algorithm">
<code class="sig-name descname">ctpc_algorithm</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#structure_estimator.StructureEstimator.ctpc_algorithm" title="Permalink to this definition"></a></dt>
<dd><p>Compute the CTPC algorithm over the entire net.</p>
</dd></dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.generate_possible_sub_sets_of_size">
<code class="sig-name descname">generate_possible_sub_sets_of_size</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">u</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">size</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">parent_label</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; Iterator<a class="headerlink" href="#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 <code class="docutils literal notranslate"><span class="pre">u</span></code> of size <code class="docutils literal notranslate"><span class="pre">size</span></code>,
that do not contains a the node identified by <code class="docutils literal notranslate"><span class="pre">parent_label</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="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>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>an Iterator Object containing a list of lists</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Iterator</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.independence_test">
<code class="sig-name descname">independence_test</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">child_states_numb</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">cim1</span><span class="p">:</span> <span class="n"><a class="reference internal" href="conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix" title="conditional_intensity_matrix.ConditionalIntensityMatrix">conditional_intensity_matrix.ConditionalIntensityMatrix</a></span></em>, <em class="sig-param"><span class="n">cim2</span><span class="p">:</span> <span class="n"><a class="reference internal" href="conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix" title="conditional_intensity_matrix.ConditionalIntensityMatrix">conditional_intensity_matrix.ConditionalIntensityMatrix</a></span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#structure_estimator.StructureEstimator.independence_test" title="Permalink to this definition"></a></dt>
<dd><p>Compute the actual independence test using two cims.
It is performed first the exponential test and if the null hypothesis is not rejected,
it is performed also the chi_test.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>child_states_numb</strong> (<em>int</em>) – the cardinality of the test child</p></li>
<li><p><strong>cim1</strong> (<a class="reference internal" href="conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix" title="conditional_intensity_matrix.ConditionalIntensityMatrix"><em>ConditionalIntensityMatrix</em></a>) – a cim belonging to the graph without test parent</p></li>
<li><p><strong>cim2</strong> (<a class="reference internal" href="conditional_intensity_matrix.html#conditional_intensity_matrix.ConditionalIntensityMatrix" title="conditional_intensity_matrix.ConditionalIntensityMatrix"><em>ConditionalIntensityMatrix</em></a>) – a cim belonging to the graph with test parent</p></li>
</ul>
</dd>
</dl>
<p>:return:True iff both tests do NOT reject the null hypothesis of indipendence. False otherwise.
:rtype: bool</p>
</dd></dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.one_iteration_of_CTPC_algorithm">
<code class="sig-name descname">one_iteration_of_CTPC_algorithm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">var_id</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">tot_vars_count</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#structure_estimator.StructureEstimator.one_iteration_of_CTPC_algorithm" title="Permalink to this definition"></a></dt>
<dd><p>Performs an iteration of the CTPC algorithm using the node <code class="docutils literal notranslate"><span class="pre">var_id</span></code> as <code class="docutils literal notranslate"><span class="pre">test_child</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var_id</strong> (<em>string</em>) – the node label of the test child</p></li>
<li><p><strong>tot_vars_count</strong> (<em>int</em>) – the number of _nodes in the net</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="structure_estimator.StructureEstimator.save_results">
<code class="sig-name descname">save_results</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#structure_estimator.StructureEstimator.save_results" title="Permalink to this definition"></a></dt>
<dd><p>Save the estimated Structure to a .json file in the path where the data are loaded from.
The file is named as the input dataset but the <a href="#id1"><span class="problematic" id="id2">results_</span></a> word is appendend to the results file.</p>
</dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -1,210 +0,0 @@
<!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>trajectory module &mdash; PyCTBN 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" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="PyCTBN documentation" href="../index.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">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">trajectory module</a></li>
</ul>
</div>
</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">
<div class="section" id="module-trajectory">
<span id="trajectory-module"></span><h1>trajectory module<a class="headerlink" href="#module-trajectory" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="trajectory.Trajectory">
<em class="property">class </em><code class="sig-prename descclassname">trajectory.</code><code class="sig-name descname">Trajectory</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">list_of_columns</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">original_cols_number</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span><a class="headerlink" href="#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>
<dl class="py method">
<dt id="trajectory.Trajectory.complete_trajectory">
<em class="property">property </em><code class="sig-name descname">complete_trajectory</code><a class="headerlink" href="#trajectory.Trajectory.complete_trajectory" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="trajectory.Trajectory.size">
<code class="sig-name descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#trajectory.Trajectory.size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="trajectory.Trajectory.times">
<em class="property">property </em><code class="sig-name descname">times</code><a class="headerlink" href="#trajectory.Trajectory.times" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="trajectory.Trajectory.trajectory">
<em class="property">property </em><code class="sig-name descname">trajectory</code><a class="headerlink" href="#trajectory.Trajectory.trajectory" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
</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:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/language_data.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>

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; PyCTBN documentation</title>
<title>Search &mdash; PyCTBN 1.0 documentation</title>
@ -26,7 +26,7 @@
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="#"/>
<link rel="top" title="PyCTBN documentation" href="index.html"/>
<link rel="top" title="PyCTBN 1.0 documentation" href="index.html"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="public" />
@ -58,8 +58,33 @@
<!-- Local TOC -->
<div class="local-toc"></div>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="PyCTBN.html">PyCTBN package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.abstract_importer">PyCTBN.abstract_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.cache">PyCTBN.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.conditional_intensity_matrix">PyCTBN.conditional_intensity_matrix module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.json_importer">PyCTBN.json_importer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.network_graph">PyCTBN.network_graph module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.parameters_estimator">PyCTBN.parameters_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.sample_path">PyCTBN.sample_path module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.set_of_cims">PyCTBN.set_of_cims module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure">PyCTBN.structure module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.structure_estimator">PyCTBN.structure_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-PyCTBN.trajectory">PyCTBN.trajectory module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyCTBN.html#module-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>
@ -120,7 +145,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2020, Filippo Martini.
&copy; Copyright 2020, Alessandro Bregoli, Filippo Martini.
</p>
</div>
@ -134,7 +159,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

File diff suppressed because one or more lines are too long

@ -12,15 +12,18 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../PyCTBN/PyCTBN'))
sys.path.insert(0, os.path.abspath('../PyCTBN/'))
print(sys.path)
# -- Project information -----------------------------------------------------
project = 'PyCTBN'
copyright = '2020, Filippo Martini'
author = 'Filippo Martini'
copyright = '2020, Alessandro Bregoli, Filippo Martini'
author = 'Alessandro Bregoli, Filippo Martini'
# The full version, including alpha/beta/rc tags
release = '1.0'
# -- General configuration ---------------------------------------------------
@ -28,7 +31,8 @@ author = 'Filippo Martini'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

@ -0,0 +1,123 @@
Examples
=============
Installation/Usage:
*******************
Implementing your own data importer
***********************************
.. code-block:: python
"""This example demonstrates the implementation of a simple data importer the extends the class abstract importer to import data in csv format.
The net in exam has three ternary nodes.
"""
from .abstract_importer import AbstractImporter
class CSVImporter(AbstractImporter):
def __init__(self, file_path):
self._df_samples_list = None
super(CSVImporter, self).__init__(file_path)
def import_data(self):
self.read_csv_file()
self._sorter = self.build_sorter(self._df_samples_list[0])
self.import_variables()
self.import_structure()
self.compute_row_delta_in_all_samples_frames(self._df_samples_list)
def read_csv_file(self):
df = pd.read_csv(self._file_path)
df.drop(df.columns[[0]], axis=1, inplace=True)
self._df_samples_list = [df]
def import_variables(self):
values_list = [3 for var in self._sorter]
# initialize dict of lists
data = {'Name':self._sorter, 'Value':values_list}
# Create the pandas DataFrame
self._df_variables = pd.DataFrame(data)
def build_sorter(self, sample_frame: pd.DataFrame) -> typing.List:
return list(sample_frame.columns)[1:]
def import_structure(self):
data = {'From':['X','Y','Z'], 'To':['Z','Z','Y']}
self._df_structure = pd.DataFrame(data)
def dataset_id(self) -> object:
pass
Parameters Estimation Example
*****************************
.. code-block:: python
from PyCTBN.PyCTBN.json_importer import JsonImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
from PyCTBN.PyCTBN.network_graph import NetworkGraph
from PyCTBN.PyCTBN.parameters_estimator import ParametersEstimator
def main():
read_files = glob.glob(os.path.join('./data', "*.json")) #Take all json files in this dir
#import data
importer = JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name')
importer.import_data(0)
#Create a SamplePath Obj passing an already filled AbstractImporter object
s1 = SamplePath(importer)
#Build The trajectries and the structural infos
s1.build_trajectories()
s1.build_structure()
print(s1.structure.edges)
print(s1.structure.nodes_values)
#From The Structure Object build the Graph
g = NetworkGraph(s1.structure)
#Select a node you want to estimate the parameters
node = g.nodes[2]
print("Node", node)
#Init the _graph specifically for THIS node
g.fast_init(node)
#Use SamplePath and Grpah to create a ParametersEstimator Object
p1 = ParametersEstimator(s1.trajectories, g)
#Init the peEst specifically for THIS node
p1.fast_init(node)
#Compute the parameters
sofc1 = p1.compute_parameters_for_node(node)
#The est CIMS are inside the resultant SetOfCIms Obj
print(sofc1.actual_cims)
Structure Estimation Example
****************************
.. code-block:: python
from PyCTBN.PyCTBN.json_importer import JsonImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
from PyCTBN.PyCTBN.structure_estimator import StructureEstimator
def structure_estimation_example():
# read the json files in ./data path
read_files = glob.glob(os.path.join('./data', "*.json"))
# initialize a JsonImporter object for the first file
importer = JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name')
# import the data at index 0 of the outer json array
importer.import_data(0)
# construct a SamplePath Object passing a filled AbstractImporter
s1 = SamplePath(importer)
# build the trajectories
s1.build_trajectories()
# build the real structure
s1.build_structure()
# construct a StructureEstimator object
se1 = StructureEstimator(s1, 0.1, 0.1)
# call the ctpc algorithm
se1.ctpc_algorithm()
# the adjacency matrix of the estimated structure
print(se1.adjacency_matrix())
# save results to a json file
se1.save_results()

@ -1,5 +1,5 @@
.. PyCTBN documentation master file, created by
sphinx-quickstart on Mon Nov 30 16:37:03 2020.
sphinx-quickstart on Mon Dec 7 15:11:12 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
@ -10,7 +10,8 @@ Welcome to PyCTBN's documentation!
:maxdepth: 2
:caption: Contents:
PyCTBN
examples
Indices and tables
==================

@ -0,0 +1,7 @@
PyCTBN
======
.. toctree::
:maxdepth: 4
PyCTBN

@ -1,48 +0,0 @@
abstract\_importer module
=========================
.. automodule:: abstract_importer
:members:
:undoc-members:
:show-inheritance:
An example of a simple CSV Importer
===================================
Suppose you have a csv dataset containing only the trajectories, three variables labels and cardinalites.
Then the resulting importer that inherit and extends AbstractImpoter would be:
.. code_block:: python
class CSVImporter(AbstractImporter):
def __init__(self, file_path):
self._df_samples_list = None
super(CSVImporter, self).__init__(file_path)
def import_data(self):
self.read_csv_file()
self._sorter = self.build_sorter(self._df_samples_list[0])
self.import_variables()
self.import_structure()
self.compute_row_delta_in_all_samples_frames(self._df_samples_list)
def read_csv_file(self):
df = pd.read_csv(self._file_path)
df.drop(df.columns[[0]], axis=1, inplace=True)
self._df_samples_list = [df]
def import_variables(self):
values_list = [3 for var in self._sorter]
# initialize dict of lists
data = {'Name':self._sorter, 'Value':values_list}
# Create the pandas DataFrame
self._df_variables = pd.DataFrame(data)
def build_sorter(self, sample_frame: pd.DataFrame) -> typing.List:
return list(sample_frame.columns)[1:]
def import_structure(self):
data = {'From':['X','Y','Z'], 'To':['Z','Z','Y']}
self._df_structure = pd.DataFrame(data)
def dataset_id(self) -> object:
pass

@ -1,7 +0,0 @@
cache module
============
.. automodule:: cache
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
conditional\_intensity\_matrix module
=====================================
.. automodule:: conditional_intensity_matrix
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
json\_importer module
=====================
.. automodule:: json_importer
:members:
:undoc-members:
:show-inheritance:

@ -1,17 +0,0 @@
scripts
=======
.. toctree::
:maxdepth: 4
abstract_importer
cache
conditional_intensity_matrix
json_importer
network_graph
parameters_estimator
sample_path
set_of_cims
structure
structure_estimator
trajectory

@ -1,7 +0,0 @@
network\_graph module
=====================
.. automodule:: network_graph
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
parameters\_estimator module
============================
.. automodule:: parameters_estimator
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
sample\_path module
===================
.. automodule:: sample_path
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
set\_of\_cims module
====================
.. automodule:: set_of_cims
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
structure module
================
.. automodule:: structure
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
structure\_estimator module
===========================
.. automodule:: structure_estimator
:members:
:undoc-members:
:show-inheritance:

@ -1,7 +0,0 @@
trajectory module
=================
.. automodule:: trajectory
:members:
:undoc-members:
:show-inheritance:

@ -0,0 +1,42 @@
import os
import glob
from PyCTBN.PyCTBN.json_importer import JsonImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
from PyCTBN.PyCTBN.network_graph import NetworkGraph
from PyCTBN.PyCTBN.parameters_estimator import ParametersEstimator
def main():
read_files = glob.glob(os.path.join('./data', "*.json")) #Take all json files in this dir
#import data
importer = JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name')
importer.import_data(0)
#Create a SamplePath Obj
s1 = SamplePath(importer)
#Build The trajectries and the structural infos
s1.build_trajectories()
s1.build_structure()
print(s1.structure.edges)
print(s1.structure.nodes_values)
#From The Structure Object build the Graph
g = NetworkGraph(s1.structure)
#Select a node you want to estimate the parameters
node = g.nodes[2]
print("Node", node)
#Init the _graph specifically for THIS node
g.fast_init(node)
#Use SamplePath and Grpah to create a ParametersEstimator Object
p1 = ParametersEstimator(s1.trajectories, g)
#Init the peEst specifically for THIS node
p1.fast_init(node)
#Compute the parameters
sofc1 = p1.compute_parameters_for_node(node)
#The est CIMS are inside the resultant SetOfCIms Obj
print(sofc1.actual_cims)
if __name__ == "__main__":
main()

@ -9,8 +9,9 @@ setup(name='PyCTBN',
description='A Continuous Time Bayesian Networks Library',
packages=find_packages(exclude=['tests', 'data']),
install_requires=[
'numpy', 'pandas', 'networkx'],
'numpy', 'pandas', 'networkx', 'scipy', 'tqdm'],
dependency_links=['https://github.com/numpy/numpy', 'https://github.com/pandas-dev/pandas',
'https://github.com/networkx/networkx'],
'https://github.com/networkx/networkx', 'https://github.com/scipy/scipy',
'https://github.com/tqdm/tqdm'],
long_description=open('README.md').read(),
zip_safe=False)

@ -0,0 +1,30 @@
import os
import glob
from PyCTBN.PyCTBN.json_importer import JsonImporter
from PyCTBN.PyCTBN.sample_path import SamplePath
from PyCTBN.PyCTBN.structure_estimator import StructureEstimator
def structure_estimation_example():
# read the json files in ./data path
read_files = glob.glob(os.path.join('./data', "*.json"))
# initialize a JsonImporter object for the first file
importer = JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name')
# import the data at index 0 of the outer json array
importer.import_data(0)
# construct a SamplePath Object passing a filled AbstractImporter
s1 = SamplePath(importer)
# build the trajectories
s1.build_trajectories()
# build the real structure
s1.build_structure()
# construct a StructureEstimator object
se1 = StructureEstimator(s1, 0.1, 0.1)
# call the ctpc algorithm
se1.ctpc_algorithm()
# the adjacency matrix of the estimated structure
print(se1.adjacency_matrix())
# save results to a json file
se1.save_results()

@ -0,0 +1,241 @@
<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.
.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.
.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.
.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.
.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.
.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.
.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
For more information on Execution Policies:
https://go.microsoft.com/fwlink/?LinkID=135170
#>
Param(
[Parameter(Mandatory = $false)]
[String]
$VenvDir,
[Parameter(Mandatory = $false)]
[String]
$Prompt
)
<# Function declarations --------------------------------------------------- #>
<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.
.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.
#>
function global:deactivate ([switch]$NonDestructive) {
# Revert to original values
# The prior prompt:
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
}
# The prior PYTHONHOME:
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
}
# The prior PATH:
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
}
# Just remove the VIRTUAL_ENV altogether:
if (Test-Path -Path Env:VIRTUAL_ENV) {
Remove-Item -Path env:VIRTUAL_ENV
}
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
}
# Leave deactivate function in the global namespace if requested:
if (-not $NonDestructive) {
Remove-Item -Path function:deactivate
}
}
<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.
If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.
.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
[String]
$ConfigDir
) {
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
# An empty map will be returned if no config file is found.
$pyvenvConfig = @{ }
if ($pyvenvConfigPath) {
Write-Verbose "File exists, parse `key = value` lines"
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
$pyvenvConfigContent | ForEach-Object {
$keyval = $PSItem -split "\s*=\s*", 2
if ($keyval[0] -and $keyval[1]) {
$val = $keyval[1]
# Remove extraneous quotations around a string value.
if ("'""".Contains($val.Substring(0, 1))) {
$val = $val.Substring(1, $val.Length - 2)
}
$pyvenvConfig[$keyval[0]] = $val
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
}
}
}
return $pyvenvConfig
}
<# Begin Activate script --------------------------------------------------- #>
# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
Write-Verbose "VenvDir=$VenvDir"
}
# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
}
Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"
# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
Write-Verbose "Setting prompt to '$Prompt'"
# Set the prompt to include the env name
# Make sure _OLD_VIRTUAL_PROMPT is global
function global:_OLD_VIRTUAL_PROMPT { "" }
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
function global:prompt {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
}
# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
Remove-Item -Path Env:PYTHONHOME
}
# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"

66
venv/bin/activate vendored

@ -0,0 +1,66 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/Zalum/Desktop/Tesi/PyCTBN/venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(venv) ${PS1:-}"
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

@ -0,0 +1,25 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/Zalum/Desktop/Tesi/PyCTBN/venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(venv) $prompt"
endif
alias pydoc python -m pydoc
rehash

@ -0,0 +1,64 @@
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
# (https://fishshell.com/); you cannot run it directly.
function deactivate -d "Exit virtual environment and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
set -e VIRTUAL_ENV
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/Users/Zalum/Desktop/Tesi/PyCTBN/venv"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset PYTHONHOME if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# Save the current fish_prompt function as the function _old_fish_prompt.
functions -c fish_prompt _old_fish_prompt
# With the original prompt function renamed, we can override with our own.
function fish_prompt
# Save the return status of the last command.
set -l old_status $status
# Output the venv prompt; color taken from the blue of the Python logo.
printf "%s%s%s" (set_color 4B8BBE) "(venv) " (set_color normal)
# Restore the return status of the previous command.
echo "exit $old_status" | .
# Output the original/"old" prompt.
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/f2py vendored

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from numpy.f2py.f2py2e import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/f2py3 vendored

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from numpy.f2py.f2py2e import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/f2py3.9 vendored

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from numpy.f2py.f2py2e import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/pip vendored

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/pip3 vendored

@ -0,0 +1,8 @@
#!/Users/Zalum/Desktop/Tesi/PyCTBN/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

Some files were not shown because too many files have changed in this diff Show More