diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7c40d77 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.js linguist-vendored +*.html linguist-vendored +*.css linguist-vendored diff --git a/.github/workflows/Build_Release.yml b/.github/workflows/Build_Release.yml new file mode 100644 index 0000000..1c1f4ed --- /dev/null +++ b/.github/workflows/Build_Release.yml @@ -0,0 +1,67 @@ + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Upload Release Asset + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + + name: Upload Release Asset + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest PyCTBN/tests/ + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install pypa/build + run: | + python -m pip install build + - name: Build project # This would actually build your project, using zip for an example artifact + run: | + python -m build --sdist --wheel --outdir dist/. + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: dwenegar/upload-release-assets@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create_release.outputs.id }} + assets_path: ./dist diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21c11eb..0545efc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,13 +4,10 @@ name: Sphinx Docs on: - push: - paths-ignore: - -'docs/**' - -'docs-out/**' - branches: [ master ] - pull_request: - branches: [ master ] + workflow_run: + workflows: ["Python package","Upload Release Asset"] + types: + - completed jobs: build: @@ -41,8 +38,8 @@ jobs: rm -rf ../docs/* cp -r _build/html/* ../docs/ cd .. - git config --local user.email "f.martini@campus.unimib.it" - git config --local user.name "philipMartini" + git config --local user.email "madlab@unimib.it" + git config --local user.name "madlabunimib" git add . git commit -m "Update documentation" -a || true # The above command will fail if no changes were present, so we ignore @@ -51,7 +48,7 @@ jobs: uses: ad-m/github-push-action@master with: branch: master - github_token: ${{ secrets.PYCTBN_TOK }} + github_token: ${{ secrets.GITHUB_TOKEN }} # =============================== diff --git a/.github/workflows/python-PyCTBN-package.yml b/.github/workflows/python-PyCTBN-package.yml index 347b134..4d624d0 100644 --- a/.github/workflows/python-PyCTBN-package.yml +++ b/.github/workflows/python-PyCTBN-package.yml @@ -5,10 +5,11 @@ name: Python package on: push: - paths-ignore: - -'docs/**' - -'docs-out/**' + paths: + - 'PyCTBN/**' branches: [ master ] + tags-ignore: + - 'v*' pull_request: branches: [ master ] @@ -37,6 +38,23 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Generate coverage report run: | - pytest PyCTBN/tests/ + pip install pytest + pip install pytest-cov + pytest PyCTBN/tests/ --cov='./' --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + files: ./coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: true + verbose: true + + + + + + diff --git a/.gitignore b/.gitignore index e7be5ce..9cf2168 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ __pycache__ **/__pycache__ **/data **/PyCTBN.egg-info -**/dist **/results_data **/.scannerwork **/build @@ -15,3 +14,4 @@ test3.json result0.png example.json test_time.py +.idea diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7195df7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 MADLabUnimib developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PyCTBN/PyCTBN/__init__.py b/PyCTBN/PyCTBN/__init__.py index faff79c..35b0094 100644 --- a/PyCTBN/PyCTBN/__init__.py +++ b/PyCTBN/PyCTBN/__init__.py @@ -1,3 +1,6 @@ + +# License: MIT License + import PyCTBN.PyCTBN.estimators from PyCTBN.PyCTBN.estimators import * import PyCTBN.PyCTBN.optimizers diff --git a/PyCTBN/PyCTBN/estimators/__init__.py b/PyCTBN/PyCTBN/estimators/__init__.py index 112086f..01fd7c6 100644 --- a/PyCTBN/PyCTBN/estimators/__init__.py +++ b/PyCTBN/PyCTBN/estimators/__init__.py @@ -1,3 +1,6 @@ + +# License: MIT License + from .fam_score_calculator import FamScoreCalculator from .parameters_estimator import ParametersEstimator from .structure_estimator import StructureEstimator diff --git a/PyCTBN/PyCTBN/estimators/fam_score_calculator.py b/PyCTBN/PyCTBN/estimators/fam_score_calculator.py index d8ec3a0..e3123fe 100644 --- a/PyCTBN/PyCTBN/estimators/fam_score_calculator.py +++ b/PyCTBN/PyCTBN/estimators/fam_score_calculator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing diff --git a/PyCTBN/PyCTBN/estimators/parameters_estimator.py b/PyCTBN/PyCTBN/estimators/parameters_estimator.py index 48b77b3..a01d549 100644 --- a/PyCTBN/PyCTBN/estimators/parameters_estimator.py +++ b/PyCTBN/PyCTBN/estimators/parameters_estimator.py @@ -1,3 +1,6 @@ + +# License: MIT License + import sys sys.path.append('../') import numpy as np diff --git a/PyCTBN/PyCTBN/estimators/structure_constraint_based_estimator.py b/PyCTBN/PyCTBN/estimators/structure_constraint_based_estimator.py index 0013d80..c0fef70 100644 --- a/PyCTBN/PyCTBN/estimators/structure_constraint_based_estimator.py +++ b/PyCTBN/PyCTBN/estimators/structure_constraint_based_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing @@ -94,7 +97,7 @@ class StructureConstraintBasedEstimator(StructureEstimator): l2 = list(self._nodes[bool_mask2]) indxs2 = self._nodes_indxs[bool_mask2] vals2 = self._nodes_vals[bool_mask2] - eds2 = list(itertools.product(p_set, test_child)) + eds2 = list(itertools.product(p_set, [test_child])) s2 = Structure(l2, indxs2, vals2, eds2, tot_vars_count) g2 = NetworkGraph(s2) g2.fast_init(test_child) @@ -199,8 +202,14 @@ class StructureConstraintBasedEstimator(StructureEstimator): return optimizer_obj.optimize_structure() - def ctpc_algorithm(self,disable_multiprocessing:bool= False ): + def ctpc_algorithm(self, disable_multiprocessing:bool= False, processes_number:int= None): """Compute the CTPC algorithm over the entire net. + + :param disable_multiprocessing: true if you desire to disable the multiprocessing operations, default to False + :type disable_multiprocessing: Boolean, optional + :param processes_number: if disable_multiprocessing is false indicates + the maximum number of process; if None it will be automatically set, default to None + :type processes_number: int, optional """ ctpc_algo = self.one_iteration_of_CTPC_algorithm total_vars_numb = self._sample_path.total_variables_count @@ -212,8 +221,6 @@ class StructureConstraintBasedEstimator(StructureEstimator): 'get the number of CPU' cpu_count = multiprocessing.cpu_count() - - 'Remove all the edges from the structure' self._sample_path.structure.clean_structure_edges() @@ -221,10 +228,14 @@ class StructureConstraintBasedEstimator(StructureEstimator): #with multiprocessing.Pool(processes=cpu_count) as pool: #with get_context("spawn").Pool(processes=cpu_count) as pool: if disable_multiprocessing: - print("DISABILITATO") + print("DISABLED") cpu_count = 1 list_edges_partial = [ctpc_algo(n,total_vars_numb) for n in self._nodes] else: + if processes_number is not None and cpu_count > processes_number: + cpu_count = processes_number + + print(f"CPU COUNT: {cpu_count}") with concurrent.futures.ProcessPoolExecutor(max_workers=cpu_count) as executor: list_edges_partial = executor.map(ctpc_algo, self._nodes, @@ -238,8 +249,18 @@ class StructureConstraintBasedEstimator(StructureEstimator): return edges - def estimate_structure(self,disable_multiprocessing:bool=False): - return self.ctpc_algorithm(disable_multiprocessing=disable_multiprocessing) + def estimate_structure(self, disable_multiprocessing:bool=False, processes_number:int= None): + """ + Compute the constraint-based algorithm to find the optimal structure + + :param disable_multiprocessing: true if you desire to disable the multiprocessing operations, default to False + :type disable_multiprocessing: Boolean, optional + :param processes_number: if disable_multiprocessing is false indicates + the maximum number of process; if None it will be automatically set, default to None + :type processes_number: int, optional + """ + return self.ctpc_algorithm(disable_multiprocessing=disable_multiprocessing, + processes_number=processes_number) diff --git a/PyCTBN/PyCTBN/estimators/structure_estimator.py b/PyCTBN/PyCTBN/estimators/structure_estimator.py index b77e21f..8840c85 100644 --- a/PyCTBN/PyCTBN/estimators/structure_estimator.py +++ b/PyCTBN/PyCTBN/estimators/structure_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing @@ -142,40 +145,34 @@ class StructureEstimator(object): return nx.difference(real_graph, self._complete_graph).edges def save_plot_estimated_structure_graph(self, file_path: str) -> None: - """Plot the estimated structure in a graphical model style, use .png extension. - Spurious edges are colored in red if a prior structure is present. - - :param file_path: path to save the file to - :type: string - """ - graph_to_draw = nx.DiGraph() - spurious_edges = self.spurious_edges() - non_spurious_edges = list(set(self._complete_graph.edges) - set(spurious_edges)) - edges_colors = ['red' if edge in spurious_edges else 'black' for edge in self._complete_graph.edges] - graph_to_draw.add_edges_from(spurious_edges) - graph_to_draw.add_edges_from(non_spurious_edges) - pos = nx.spring_layout(graph_to_draw, k=0.5*1/np.sqrt(len(graph_to_draw.nodes())), iterations=50,scale=10) - options = { - "node_size": 2000, - "node_color": "white", - "edgecolors": "black", - 'linewidths':2, - "with_labels":True, - "font_size":13, - 'connectionstyle': 'arc3, rad = 0.1', - "arrowsize": 15, - "arrowstyle": '<|-', - "width": 1, - "edge_color":edges_colors, - } - - nx.draw(graph_to_draw, pos, **options) - ax = plt.gca() - ax.margins(0.20) - plt.axis("off") - plt.savefig(file_path) - plt.clf() - print("Estimated Structure Plot Saved At: ", os.path.abspath(file_path)) + """Plot the estimated structure in a graphical model style, use .png extension. + + :param file_path: path to save the file to + :type: string + """ + pos = nx.spring_layout(self._complete_graph, k=0.5*1/np.sqrt(len(self._complete_graph.nodes)), + iterations=50,scale=10) + options = { + "node_size": 2000, + "node_color": "white", + "edgecolors": "black", + 'linewidths':2, + "with_labels":True, + "font_size":13, + 'connectionstyle': 'arc3, rad = 0.1', + "arrowsize": 15, + #"arrowstyle": '<|-', + "width": 1, + #"edge_color":edges_colors, + } + + nx.draw(self._complete_graph, pos, **options) + ax = plt.gca() + ax.margins(0.20) + plt.axis("off") + plt.savefig(file_path) + plt.clf() + print("Estimated Structure Plot Saved At: ", os.path.abspath(file_path)) diff --git a/PyCTBN/PyCTBN/estimators/structure_score_based_estimator.py b/PyCTBN/PyCTBN/estimators/structure_score_based_estimator.py index 12222f9..70523ee 100644 --- a/PyCTBN/PyCTBN/estimators/structure_score_based_estimator.py +++ b/PyCTBN/PyCTBN/estimators/structure_score_based_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing @@ -54,7 +57,7 @@ class StructureScoreBasedEstimator(StructureEstimator): def estimate_structure(self, max_parents:int = None, iterations_number:int= 40, patience:int = None, tabu_length:int = None, tabu_rules_duration:int = None, - optimizer: str = 'tabu',disable_multiprocessing:bool= False ): + optimizer: str = 'tabu', disable_multiprocessing:bool= False, processes_number:int= None): """ Compute the score-based algorithm to find the optimal structure @@ -72,6 +75,9 @@ class StructureScoreBasedEstimator(StructureEstimator): :type optimizer: string, optional :param disable_multiprocessing: true if you desire to disable the multiprocessing operations, default to False :type disable_multiprocessing: Boolean, optional + :param processes_number: if disable_multiprocessing is false indicates + the maximum number of process; if None it will be automatically set, default to None + :type processes_number: int, optional """ 'Save the true edges structure in tuples' true_edges = copy.deepcopy(self._sample_path.structure.edges) @@ -93,11 +99,12 @@ class StructureScoreBasedEstimator(StructureEstimator): 'get the number of CPU' - cpu_count = multiprocessing.cpu_count() - print(f"CPU COUNT: {cpu_count}") + cpu_count = multiprocessing.cpu_count() if disable_multiprocessing: cpu_count = 1 + elif processes_number is not None and cpu_count > processes_number: + cpu_count = processes_number @@ -106,6 +113,8 @@ class StructureScoreBasedEstimator(StructureEstimator): #with get_context("spawn").Pool(processes=cpu_count) as pool: #with multiprocessing.Pool(processes=cpu_count) as pool: + print(f"CPU COUNT: {cpu_count}") + 'Estimate the best parents for each node' if disable_multiprocessing: list_edges_partial = [estimate_parents(n,max_parents,iterations_number,patience,tabu_length,tabu_rules_duration,optimizer) for n in self._nodes] diff --git a/PyCTBN/PyCTBN/optimizers/__init__.py b/PyCTBN/PyCTBN/optimizers/__init__.py index 4162bf1..ffa10d4 100644 --- a/PyCTBN/PyCTBN/optimizers/__init__.py +++ b/PyCTBN/PyCTBN/optimizers/__init__.py @@ -1,3 +1,6 @@ + +# License: MIT License + from .optimizer import Optimizer from .tabu_search import TabuSearch from .hill_climbing_search import HillClimbing diff --git a/PyCTBN/PyCTBN/optimizers/constraint_based_optimizer.py b/PyCTBN/PyCTBN/optimizers/constraint_based_optimizer.py index 9ad05fc..aeb67fc 100644 --- a/PyCTBN/PyCTBN/optimizers/constraint_based_optimizer.py +++ b/PyCTBN/PyCTBN/optimizers/constraint_based_optimizer.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing diff --git a/PyCTBN/PyCTBN/optimizers/hill_climbing_search.py b/PyCTBN/PyCTBN/optimizers/hill_climbing_search.py index 6783be0..ede3db7 100644 --- a/PyCTBN/PyCTBN/optimizers/hill_climbing_search.py +++ b/PyCTBN/PyCTBN/optimizers/hill_climbing_search.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing diff --git a/PyCTBN/PyCTBN/optimizers/optimizer.py b/PyCTBN/PyCTBN/optimizers/optimizer.py index 1984f06..e62aced 100644 --- a/PyCTBN/PyCTBN/optimizers/optimizer.py +++ b/PyCTBN/PyCTBN/optimizers/optimizer.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing diff --git a/PyCTBN/PyCTBN/optimizers/tabu_search.py b/PyCTBN/PyCTBN/optimizers/tabu_search.py index b7b2bc9..7650732 100644 --- a/PyCTBN/PyCTBN/optimizers/tabu_search.py +++ b/PyCTBN/PyCTBN/optimizers/tabu_search.py @@ -1,4 +1,7 @@ +# License: MIT License + + import itertools import json import typing @@ -184,5 +187,5 @@ class TabuSearch(Optimizer): if self.patience is not None and patince_count > self.patience: break - print(f"finito variabile: {self.node_id}") - return graph.edges \ No newline at end of file + print(f"Finished variable : {self.node_id}") + return graph.edges diff --git a/PyCTBN/PyCTBN/structure_graph/__init__.py b/PyCTBN/PyCTBN/structure_graph/__init__.py index 85f18a2..b9c24e5 100644 --- a/PyCTBN/PyCTBN/structure_graph/__init__.py +++ b/PyCTBN/PyCTBN/structure_graph/__init__.py @@ -1,3 +1,6 @@ + +# License: MIT License + from .conditional_intensity_matrix import ConditionalIntensityMatrix from .network_graph import NetworkGraph from .sample_path import SamplePath diff --git a/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py b/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py index 79dc0d1..d5df8d7 100644 --- a/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py +++ b/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py @@ -1,3 +1,6 @@ + +# License: MIT License + import numpy as np diff --git a/PyCTBN/PyCTBN/structure_graph/network_graph.py b/PyCTBN/PyCTBN/structure_graph/network_graph.py index 6fb3639..254555d 100644 --- a/PyCTBN/PyCTBN/structure_graph/network_graph.py +++ b/PyCTBN/PyCTBN/structure_graph/network_graph.py @@ -1,4 +1,7 @@ +# License: MIT License + + import typing import networkx as nx diff --git a/PyCTBN/PyCTBN/structure_graph/sample_path.py b/PyCTBN/PyCTBN/structure_graph/sample_path.py index 88e9649..a924fe4 100644 --- a/PyCTBN/PyCTBN/structure_graph/sample_path.py +++ b/PyCTBN/PyCTBN/structure_graph/sample_path.py @@ -1,4 +1,7 @@ +# License: MIT License + + import numpy as np import pandas as pd diff --git a/PyCTBN/PyCTBN/structure_graph/set_of_cims.py b/PyCTBN/PyCTBN/structure_graph/set_of_cims.py index 060f6d9..16d5b1b 100644 --- a/PyCTBN/PyCTBN/structure_graph/set_of_cims.py +++ b/PyCTBN/PyCTBN/structure_graph/set_of_cims.py @@ -1,4 +1,7 @@ +# License: MIT License + + import typing diff --git a/PyCTBN/PyCTBN/structure_graph/structure.py b/PyCTBN/PyCTBN/structure_graph/structure.py index f79c875..eb3edda 100644 --- a/PyCTBN/PyCTBN/structure_graph/structure.py +++ b/PyCTBN/PyCTBN/structure_graph/structure.py @@ -1,4 +1,7 @@ +# License: MIT License + + import typing as ty import numpy as np diff --git a/PyCTBN/PyCTBN/structure_graph/trajectory.py b/PyCTBN/PyCTBN/structure_graph/trajectory.py index 36899b3..5e86316 100644 --- a/PyCTBN/PyCTBN/structure_graph/trajectory.py +++ b/PyCTBN/PyCTBN/structure_graph/trajectory.py @@ -1,4 +1,7 @@ +# License: MIT License + + import typing import numpy as np diff --git a/PyCTBN/PyCTBN/utility/__init__.py b/PyCTBN/PyCTBN/utility/__init__.py index f79749c..eefdb59 100644 --- a/PyCTBN/PyCTBN/utility/__init__.py +++ b/PyCTBN/PyCTBN/utility/__init__.py @@ -1,3 +1,6 @@ + +# License: MIT License + from .abstract_importer import AbstractImporter from .cache import Cache from .json_importer import JsonImporter diff --git a/PyCTBN/PyCTBN/utility/abstract_importer.py b/PyCTBN/PyCTBN/utility/abstract_importer.py index 8984b4d..9328a65 100644 --- a/PyCTBN/PyCTBN/utility/abstract_importer.py +++ b/PyCTBN/PyCTBN/utility/abstract_importer.py @@ -1,4 +1,7 @@ +# License: MIT License + + import typing from abc import ABC, abstractmethod diff --git a/PyCTBN/PyCTBN/utility/cache.py b/PyCTBN/PyCTBN/utility/cache.py index 5191af3..10caa22 100644 --- a/PyCTBN/PyCTBN/utility/cache.py +++ b/PyCTBN/PyCTBN/utility/cache.py @@ -1,4 +1,7 @@ +# License: MIT License + + import typing from ..structure_graph.set_of_cims import SetOfCims diff --git a/PyCTBN/PyCTBN/utility/json_importer.py b/PyCTBN/PyCTBN/utility/json_importer.py index 6b6c3ed..781be4d 100644 --- a/PyCTBN/PyCTBN/utility/json_importer.py +++ b/PyCTBN/PyCTBN/utility/json_importer.py @@ -1,3 +1,6 @@ + +# License: MIT License + import json import typing @@ -50,10 +53,10 @@ class JsonImporter(AbstractImporter): super(JsonImporter, self).__init__(file_path) self._raw_data = self.read_json_file() - def import_data(self, indx: int) -> None: + def import_data(self, indx: int = 0) -> None: """Implements the abstract method of :class:`AbstractImporter`. - :param indx: the index of the outer JsonArray to extract the data from + :param indx: the index of the outer JsonArray to extract the data from, default to 0 :type indx: int """ self._array_indx = indx @@ -105,7 +108,12 @@ class JsonImporter(AbstractImporter): """ with open(self._file_path) as f: data = json.load(f) - return data + + if (isinstance(data,list)): + return data + else: + return [data] + def one_level_normalizing(self, raw_data: typing.List, indx: int, key: str) -> pd.DataFrame: """Extracts the one-level nested data in the list ``raw_data`` at the index ``indx`` at the key ``key``. diff --git a/PyCTBN/PyCTBN/utility/sample_importer.py b/PyCTBN/PyCTBN/utility/sample_importer.py index b0b6e8f..4c3fdf0 100644 --- a/PyCTBN/PyCTBN/utility/sample_importer.py +++ b/PyCTBN/PyCTBN/utility/sample_importer.py @@ -1,3 +1,6 @@ + +# License: MIT License + import json import typing diff --git a/PyCTBN/__init__.py b/PyCTBN/__init__.py index 7adf0d7..6fd2d6c 100644 --- a/PyCTBN/__init__.py +++ b/PyCTBN/__init__.py @@ -1,2 +1,5 @@ + +# License: MIT License + import PyCTBN.PyCTBN from PyCTBN.PyCTBN import * diff --git a/PyCTBN/basic_main.py b/PyCTBN/basic_main.py deleted file mode 100644 index b1288db..0000000 --- a/PyCTBN/basic_main.py +++ /dev/null @@ -1,39 +0,0 @@ -import glob -import os - -import sys -sys.path.append("./PyCTBN/") - -import structure_graph.network_graph as ng -import structure_graph.sample_path as sp -import structure_graph.set_of_cims as sofc -import estimators.parameters_estimator as pe -import utility.json_importer as ji - - -def main(): - read_files = glob.glob(os.path.join('./data', "*.json")) #Take all json files in this dir - #import data - importer = ji.JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name') - #Create a SamplePath Obj - s1 = sp.SamplePath(importer) - #Build The trajectries and the structural infos - s1.build_trajectories() - s1.build_structure() - #From The Structure Object build the Graph - g = ng.NetworkGraph(s1.structure) - #Select a node you want to estimate the parameters - node = g.nodes[1] - #Init the graph specifically for THIS node - g.fast_init(node) - #Use SamplePath and Grpah to create a ParametersEstimator Object - p1 = pe.ParametersEstimator(s1, 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() diff --git a/PyCTBN/setup.py b/PyCTBN/setup.py deleted file mode 100644 index 56dd72f..0000000 --- a/PyCTBN/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -from setuptools import setup, find_packages - - -setup(name='PyCTBN', - version='1.0', - url='https://github.com/philipMartini/PyCTBN', - license='MIT', - author=['Alessandro Bregoli', 'Filippo Martini','Luca Moretti'], - author_email=['a.bregoli1@campus.unimib.it', 'f.martini@campus.unimib.it','lucamoretti96@gmail.com'], - description='A Continuous Time Bayesian Networks Library', - packages=find_packages('.', exclude=['tests']), - #packages=['PyCTBN.PyCTBN'], - install_requires=[ - 'numpy', 'pandas', 'networkx', 'scipy', 'matplotlib', 'tqdm'], - dependency_links=['https://github.com/numpy/numpy', 'https://github.com/pandas-dev/pandas', - 'https://github.com/networkx/networkx', 'https://github.com/scipy/scipy', - 'https://github.com/tqdm/tqdm'], - #long_description=open('../README.md').read(), - zip_safe=False, - python_requires='>=3.6') diff --git a/PyCTBN/tests/__init__.py b/PyCTBN/tests/__init__.py index 8b13789..8f6a58e 100644 --- a/PyCTBN/tests/__init__.py +++ b/PyCTBN/tests/__init__.py @@ -1 +1,4 @@ +# License: MIT License + + diff --git a/PyCTBN/tests/estimators/test_parameters_estimator.py b/PyCTBN/tests/estimators/test_parameters_estimator.py index 5c438db..4dbb548 100644 --- a/PyCTBN/tests/estimators/test_parameters_estimator.py +++ b/PyCTBN/tests/estimators/test_parameters_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import numpy as np import glob diff --git a/PyCTBN/tests/estimators/test_structure_constraint_based_estimator.py b/PyCTBN/tests/estimators/test_structure_constraint_based_estimator.py index b69d445..baa1de1 100644 --- a/PyCTBN/tests/estimators/test_structure_constraint_based_estimator.py +++ b/PyCTBN/tests/estimators/test_structure_constraint_based_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import glob import math import os @@ -54,7 +57,7 @@ class TestStructureConstraintBasedEstimator(unittest.TestCase): true_edges = set(map(tuple, true_edges)) se1 = StructureConstraintBasedEstimator(self.s1,0.1,0.1) - edges = se1.estimate_structure(True) + edges = se1.estimate_structure(processes_number=2) self.assertFalse(se1.spurious_edges()) self.assertEqual(edges, true_edges) diff --git a/PyCTBN/tests/estimators/test_structure_estimator.py b/PyCTBN/tests/estimators/test_structure_estimator.py index e368b93..5decc84 100644 --- a/PyCTBN/tests/estimators/test_structure_estimator.py +++ b/PyCTBN/tests/estimators/test_structure_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import glob import math import os diff --git a/PyCTBN/tests/estimators/test_structure_score_based_estimator.py b/PyCTBN/tests/estimators/test_structure_score_based_estimator.py index 8cbbcb5..16f1645 100644 --- a/PyCTBN/tests/estimators/test_structure_score_based_estimator.py +++ b/PyCTBN/tests/estimators/test_structure_score_based_estimator.py @@ -1,4 +1,7 @@ +# License: MIT License + + import glob import math import os @@ -111,7 +114,8 @@ class TestStructureScoreBasedEstimator(unittest.TestCase): tabu_length = 15, tabu_rules_duration = 15, optimizer = 'hill', - disable_multiprocessing=False + disable_multiprocessing=False, + processes_number=2 ) @@ -240,6 +244,7 @@ class TestStructureScoreBasedEstimator(unittest.TestCase): self.assertGreaterEqual(recall,0.75) + if __name__ == '__main__': unittest.main() diff --git a/PyCTBN/tests/optimizers/test_hill_climbing_search.py b/PyCTBN/tests/optimizers/test_hill_climbing_search.py index 1ca8f8c..b669478 100644 --- a/PyCTBN/tests/optimizers/test_hill_climbing_search.py +++ b/PyCTBN/tests/optimizers/test_hill_climbing_search.py @@ -1,4 +1,7 @@ +# License: MIT License + + import glob import math import os @@ -54,9 +57,9 @@ class TestHillClimbingSearch(unittest.TestCase): def test_structure_3(self): with open("./PyCTBN/test_data/networks_and_trajectories_ternary_data_01_6_1.json") as f: raw_data = json.load(f) - + trajectory_list_raw= raw_data["samples"] - + # Convert to DataFrame trajectory_list = [pd.DataFrame(sample) for sample in trajectory_list_raw] variables= raw_data["variables"] diff --git a/PyCTBN/tests/optimizers/test_tabu_search.py b/PyCTBN/tests/optimizers/test_tabu_search.py index 54f6a2f..0d52141 100644 --- a/PyCTBN/tests/optimizers/test_tabu_search.py +++ b/PyCTBN/tests/optimizers/test_tabu_search.py @@ -1,3 +1,6 @@ + +# License: MIT License + import sys sys.path.append("../../PyCTBN/") import glob @@ -75,7 +78,8 @@ class TestTabuSearch(unittest.TestCase): def test_structure_3(self): with open("./PyCTBN/test_data/networks_and_trajectories_ternary_data_01_6_1.json") as f: raw_data = json.load(f) - + + # read the samples trajectory_list_raw= raw_data["samples"] trajectory_list = [pd.DataFrame(sample) for sample in trajectory_list_raw] diff --git a/PyCTBN/tests/structure_graph/test_cim.py b/PyCTBN/tests/structure_graph/test_cim.py index 04bc642..aa9e9fc 100644 --- a/PyCTBN/tests/structure_graph/test_cim.py +++ b/PyCTBN/tests/structure_graph/test_cim.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import numpy as np @@ -34,10 +37,10 @@ class TestConditionalIntensityMatrix(unittest.TestCase): c2[i, j] = (c2[i, j] + 1) / (self.state_res_times[i] + 1) c1.compute_cim_coefficients() for i in range(0, len(c1.state_residence_times)): - self.assertTrue(np.isclose(np.sum(c1.cim[i]), 0.0, 1e01, 1e-01)) + self.assertTrue(np.isclose(np.sum(c1.cim[i]), 0.0, 1e01,1e01)) for i in range(0, len(self.state_res_times)): for j in range(0, len(self.state_res_times)): - self.assertTrue(np.isclose(c1.cim[i, j], c2[i, j], 1e01, 1e-01)) + self.assertTrue(np.isclose(c1.cim[i, j], c2[i, j], 1e01)) def test_repr(self): c1 = ConditionalIntensityMatrix(state_residence_times = self.state_res_times, diff --git a/PyCTBN/tests/structure_graph/test_networkgraph.py b/PyCTBN/tests/structure_graph/test_networkgraph.py index d9b9bcd..790cbed 100644 --- a/PyCTBN/tests/structure_graph/test_networkgraph.py +++ b/PyCTBN/tests/structure_graph/test_networkgraph.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import glob import os diff --git a/PyCTBN/tests/structure_graph/test_sample_path.py b/PyCTBN/tests/structure_graph/test_sample_path.py index f7b3a1a..ef63585 100644 --- a/PyCTBN/tests/structure_graph/test_sample_path.py +++ b/PyCTBN/tests/structure_graph/test_sample_path.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import glob import os diff --git a/PyCTBN/tests/structure_graph/test_setofcims.py b/PyCTBN/tests/structure_graph/test_setofcims.py index a158553..d471779 100644 --- a/PyCTBN/tests/structure_graph/test_setofcims.py +++ b/PyCTBN/tests/structure_graph/test_setofcims.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import numpy as np import itertools diff --git a/PyCTBN/tests/structure_graph/test_structure.py b/PyCTBN/tests/structure_graph/test_structure.py index df4289e..e979318 100644 --- a/PyCTBN/tests/structure_graph/test_structure.py +++ b/PyCTBN/tests/structure_graph/test_structure.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import numpy as np from ...PyCTBN.structure_graph.structure import Structure diff --git a/PyCTBN/tests/structure_graph/test_trajectory.py b/PyCTBN/tests/structure_graph/test_trajectory.py index ae4777b..93c27a7 100644 --- a/PyCTBN/tests/structure_graph/test_trajectory.py +++ b/PyCTBN/tests/structure_graph/test_trajectory.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import numpy as np import glob diff --git a/PyCTBN/tests/utility/test_cache.py b/PyCTBN/tests/utility/test_cache.py index df32b1b..4f0c47f 100644 --- a/PyCTBN/tests/utility/test_cache.py +++ b/PyCTBN/tests/utility/test_cache.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import numpy as np diff --git a/PyCTBN/tests/utility/test_json_importer.py b/PyCTBN/tests/utility/test_json_importer.py index 877805b..d57a258 100644 --- a/PyCTBN/tests/utility/test_json_importer.py +++ b/PyCTBN/tests/utility/test_json_importer.py @@ -1,4 +1,7 @@ +# License: MIT License + + import unittest import os import glob @@ -39,7 +42,7 @@ class TestJsonImporter(unittest.TestCase): path = os.getcwd() path = path + '/data.json' j1 = JsonImporter(path, '', '', '', '', '') - self.assertTrue(self.ordered(data_set) == self.ordered(j1._raw_data)) + self.assertTrue(self.ordered([data_set]) == self.ordered(j1._raw_data)) os.remove('data.json') def test_read_json_file_not_found(self): @@ -155,7 +158,7 @@ class TestJsonImporter(unittest.TestCase): self.assertEqual(j1.file_path, "./PyCTBN/test_data/networks_and_trajectories_binary_data_01_3.json") def test_import_data(self): - j1 = JsonImporter("./PyCTBN/test_data/networks_and_trajectories_binary_data_01_3.json", 'samples', 'dyn.str', 'variables', 'Time', 'Name') + j1 = JsonImporter("./PyCTBN/test_data/networks_and_trajectories_binary_data_02_10_1.json", 'samples', 'dyn.str', 'variables', 'Time', 'Name') j1.import_data(0) self.assertEqual(list(j1.variables[j1._variables_key]), list(j1.concatenated_samples.columns.values[1:len(j1.variables[j1._variables_key]) + 1])) diff --git a/PyCTBN/tests/utility/test_sample_importer.py b/PyCTBN/tests/utility/test_sample_importer.py index aa9a5a7..f938c70 100644 --- a/PyCTBN/tests/utility/test_sample_importer.py +++ b/PyCTBN/tests/utility/test_sample_importer.py @@ -1,13 +1,19 @@ +# License: MIT License + + import unittest import os import glob +import json import numpy as np import pandas as pd + + from ...PyCTBN.utility.sample_importer import SampleImporter from ...PyCTBN.structure_graph.sample_path import SamplePath -import json + @@ -17,9 +23,10 @@ class TestSampleImporter(unittest.TestCase): def setUpClass(cls) -> None: with open("./PyCTBN/test_data/networks_and_trajectories_binary_data_01_3.json") as f: raw_data = json.load(f) - + + #read the samples trajectory_list_raw= raw_data[0]["samples"] - + cls.trajectory_list = [pd.DataFrame(sample) for sample in trajectory_list_raw] cls.variables= pd.DataFrame(raw_data[0]["variables"]) diff --git a/README.rst b/README.rst index 27773ca..c6636bc 100644 --- a/README.rst +++ b/README.rst @@ -1,27 +1,64 @@ PyCTBN ====== +.. image:: https://codecov.io/gh/madlabunimib/PyCTBN/branch/master/graph/badge.svg + :target: https://codecov.io/gh/madlabunimib/PyCTBN + + + + A Continuous Time Bayesian Networks Library Installation/Usage ******************* -Download the release in .tar.gz or .whl format and simply use pip install to install it:: - $ pip install PyCTBN-1.0.tar.gz +The library has been tested on Linux and Windows with Python 3.8 and it relies on the following Python modules: +- numpy +- pandas +- networkx +- scipy +- matplotlib +- tqdm + +**Pip installation** + +Download the latest release in .tar.gz or .whl format and simply use pip install to install it: + + $ pip install PyCTBN-2.2.tar.gz + Documentation ************* -Please refer to https://philipmartini.github.io/PyCTBN/ for the full project documentation. +Please refer to https://madlabunimib.github.io/PyCTBN/ for the full project documentation. Implementing your own data importer *********************************** -.. code-block:: python +| This example demonstrates the implementation of a simple data importer the extends the class AbstractImporter +| to import data in csv format. The net in exam has three ternary nodes and no prior net structure. +| Suppose the trajectories that have to be inported have this structure: + +.. image:: docs-out/esempio_dataset.png + :width: 600 + :alt: An example trajectory to be imported. + +| In the read_csv_file method the data are imported in memory, put in a list and assigned to the _df_samples_list class +| member, so that it contains all the trajectories to be processed. +| In the import_variables method the dataframe containing the nodes labels and the cardinalities of the nodes +| is assigned to the _df_variables class member. +| The class member _sorter has to contain the nodes labels in the same order of the trajectory columns, +| just override the build_sorter method to do that. +| If your datasets names have particular id, you can keep it using the dataset_id method to assign the id to a new class member. +| Finally the import_data method call all the previously implemented methods and calls the compute_row_delta_in_all_samples_frames +| to process all the trajectories in _df_samples_list. +| For more information about the class memebers and methods of AbstractImporter please refer to the documentation. - """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 and no prior net structure. - """ +.. code-block:: python + import pandas as pd + import typing + from PyCTBN import AbstractImporter + from PyCTBN import SamplePath class CSVImporter(AbstractImporter): @@ -53,73 +90,256 @@ Implementing your own data importer def dataset_id(self) -> object: pass -Parameters Estimation Example -***************************** + def main(): + # create the importer object + csvimp = CSVImporter('/dataset_example.csv') + # call the wrapping method that wil import and process the data + csvimp.import_data() + # pass the AbstractImporter object to the SamplePath constructor + s1 = SamplePath(csvimp) + # SamplePath will contain the Trajecotry object... + s1.build_trajectories() + #...and the Structure object with all the process data + s1.build_structure() + + +Structure Estimation Examples +############################## + +| In this section some examples will be shown in order to provide some useful information about the usage of the library + + +Constraint based estimation +**************************** +| This example shows how to estimate the structure given a series of trajectories using a constraint based approach. +| The first three instructions import all the necessary data (trajectories, nodes cardinalities, nodes labels), +| and are contextual to the dataset that is been used, in the code comments are marked as optional <>. +| If your data has a different structure or format you should implement your own importer +| (see Implementing your own importer example). +| The other instructions are not optional and should follow the same order. +| A SamplePath object is been created, passing an AbstractImporter object that contains the correct class members +| filled with the data that are necessary to estimate the structure. +| Next the build_trajectories and build_structure methods are called to instantiate the objects that will contain +| the processed trajectories and all the net information. +| Then an estimator object is created, in this case a constraint based estimator, +| it necessary to pass a SamplePath object where build_trajectories and build_structure methods have already been called. +| If you have prior knowledge about the net structure pass it to the constructor with the known_edges parameter. +| The other three parameters are contextual to the StructureConstraintBasedEstimator, see the documentation for more details. +| To estimate the structure simply call the estimate_structure method. +| You can obtain the estimated structure as a boolean adjacency matrix with the method adjacency_matrix, +| or save it as a json file that contains all the nodes labels, and obviously the estimated edges. +| You can also save a graphical model representation of the estimated structure +| with the save_plot_estimated_structure_graph. .. code-block:: python + import glob + import os + from PyCTBN import JsonImporter from PyCTBN import SamplePath - from PyCTBN import NetworkGraph - from PyCTBN import ParametersEstimator + from PyCTBN import StructureConstraintBasedEstimator - 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') + def structure_constraint_based_estimation_example(): + # + read_files = glob.glob(os.path.join('./data', "*.json")) + # + importer = JsonImporter(file_path=read_files[0], samples_label='samples', + structure_label='dyn.str', variables_label='variables', + time_key='Time', variables_key='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 + # construct a SamplePath Object passing a filled AbstractImporter object + s1 = SamplePath(importer=importer) + # build the trajectories s1.build_trajectories() + # build the information about the net 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 -**************************** + # construct a StructureEstimator object passing a correctly build SamplePath object + # and the independence tests significance, if you have prior knowledge about + # the net structure create a list of tuples + # that contains them and pass it as known_edges parameter + se1 = StructureConstraintBasedEstimator(sample_path=s1, exp_test_alfa=0.1, chi_test_alfa=0.1, + known_edges=[], thumb_threshold=25) + # call the algorithm to estimate the structure + se1.estimate_structure() + # obtain the adjacency matrix of the estimated structure + print(se1.adjacency_matrix()) + # save the estimated structure to a json file + # (remember to specify the path AND the .json extension).... + se1.save_results('./results0.json') + # ...or save it also in a graphical model fashion + # (remember to specify the path AND the .png extension) + se1.save_plot_estimated_structure_graph('./result0.png') + + + +Score based estimation with Hill Climbing +***************************************** + +| This example shows how to estimate the structure given a series of trajectories using a score based approach +| and the Hill Climbing algorithm as optimization strategy. +| The structure of the code is the same as the previus example, but an explanation of the Structure score based estimator +| will be provided. +| Then an estimator object is created, in this case a score based estimator, +| it necessary to pass a SamplePath object where build_trajectories and build_structure methods have already been called. +| If you have prior knowledge about the net structure pass it to the constructor with the known_edges parameter. +| The other parameters are contextual to the StructureScoreBasedEstimator, see the documentation for more details. +| To estimate the structure simply call the estimate_structure method passing the desidered parameters, such as the +| optimization strategy, or simply use the default configuration. +| In this case an Hill Climbing approch is choosen. .. code-block:: python + import glob + import os + from PyCTBN import JsonImporter from PyCTBN import SamplePath - from PyCTBN import StructureEstimator - - def structure_estimation_example(): + from PyCTBN import StructureScoreBasedEstimator + - # read the json files in ./data path + def structure_constraint_based_estimation_example(): + # 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 = JsonImporter(file_path=read_files[0], samples_label='samples', + structure_label='dyn.str', variables_label='variables', + time_key='Time', variables_key='Name') + # importer.import_data(0) - # construct a SamplePath Object passing a filled AbstractImporter - s1 = SamplePath(importer) + # construct a SamplePath Object passing a filled AbstractImporter object + s1 = SamplePath(importer=importer) + # build the trajectories + s1.build_trajectories() + # build the information about the net + s1.build_structure() + # construct a StructureEstimator object passing a correctly build SamplePath object + # and hyperparameters tau and alpha, if you have prior knowledge about + # the net structure create a list of tuples + # that contains them and pass it as known_edges parameter + se1 = StructureScoreBasedEstimator(sample_path=s1, tau_xu = 0.1, alpha_xu = 1, + known_edges=[]) + # call the algorithm to estimate the structure + # and pass all the desidered parameters, in this case an Hill Climbing approach + # will be selected as optimization strategy. + se1.estimate_structure( + max_parents = None, + iterations_number = 40, + patience = None, + optimizer = 'hill' + ) + # obtain the adjacency matrix of the estimated structure + print(se1.adjacency_matrix()) + # save the estimated structure to a json file + # (remember to specify the path AND the .json extension).... + se1.save_results('./results0.json') + # ...or save it also in a graphical model fashion + # (remember to specify the path AND the .png extension) + se1.save_plot_estimated_structure_graph('./result0.png') + + +Score based estimation with Tabu Search and Data Augmentation +************************************************************** + +| This example shows how to estimate the structure given a series of trajectories using a score based approach +| and the Tabu Search algorithm as optimization strategy and how to use a data augmentation strategy to increase the +| number of data available. +| The structure of the code is the same as the previus example, but an explanation of the data augmentation technique +| will be provided. +| In this case a SampleImporter is used to import the data instead of a JsonImporter. +| Using a SampleImporter requires the user to read the data and put it into different lists or DataFrames before to +| inizialize the SampleImporter instance. +| Then it is possible to increase the amount of data by using one of the external libraries who provide data augmentation +| approaches, in this example sklearn is used. +| Then all the information can be passed to the SampleImporter constructor and the import_data method can be used to provide +| the preprossing operations of the PyCTBN library. +| Then an estimator object is created, in this case a score based estimator, +| it necessary to pass a SamplePath object where build_trajectories and build_structure methods have already been called. +| If you have prior knowledge about the net structure pass it to the constructor with the known_edges parameter. +| The other parameters are contextual to the StructureScoreBasedEstimator, see the documentation for more details. +| To estimate the structure simply call the estimate_structure method passing the desidered parameters, such as the +| optimization strategy, or simply use the default configuration. +| In this case an Hill Climbing approch is choosen. + + +.. code-block:: python + + import glob + import os + + from sklearn.utils import resample + + from PyCTBN import SampleImporter + from PyCTBN import SamplePath + from PyCTBN import StructureScoreBasedEstimator + + + def structure_constraint_based_estimation_example(): + # + read_files = glob.glob(os.path.join('./data', "*.json")) + + # read the first file in the directory (or pass the file path) + with open(file_path=read_files[0]) as f: + raw_data = json.load(f) + + # read the variables information + variables= pd.DataFrame(raw_data[0]["variables"]) + + # read the prior information if they are given + prior_net_structure = pd.DataFrame(raw_data[0]["dyn.str"]) + + #read the samples + trajectory_list_raw= raw_data[0]["samples"] + + #convert them in DataFrame + trajectory_list = [pd.DataFrame(sample) for sample in trajectory_list_raw] + + # use an external library in order to provide the data augmentation operations, in this case + # sklearn.utils is used + augmented_trajectory_list = resample (trajectory_list, replace = True, n_samples = 300 ) + + + # + importer = SampleImporter( + trajectory_list = augmented_trajectory_list, + variables=variables, + prior_net_structure=prior_net_structure + ) + + # + importer.import_data() + # construct a SamplePath Object passing a filled AbstractImporter object + + s1 = SamplePath(importer=importer) # build the trajectories s1.build_trajectories() - # build the real structure + # build the information about the net 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 + # construct a StructureEstimator object passing a correctly build SamplePath object + # and hyperparameters tau and alpha, if you have prior knowledge about + # the net structure create a list of tuples + # that contains them and pass it as known_edges parameter + se1 = StructureScoreBasedEstimator(sample_path=s1, tau_xu = 0.1, alpha_xu = 1, + known_edges=[]) + # call the algorithm to estimate the structure + # and pass all the desidered parameters, in this case a Tabu Search approach + # will be selected as optimization strategy. It is possible to select the tabu list length and + # the tabu rules duration, and the other parameters as in the previus example. + se1.estimate_structure( + max_parents = None, + iterations_number = 100, + patience = 20, + optimizer = 'tabu', + tabu_length = 10, + tabu_rules_duration = 10 + ) + # obtain the adjacency matrix of the estimated structure print(se1.adjacency_matrix()) - # save results to a json file - se1.save_results() + # save the estimated structure to a json file + # (remember to specify the path AND the .json extension).... + se1.save_results('./results0.json') + # ...or save it also in a graphical model fashion + # (remember to specify the path AND the .png extension) + se1.save_plot_estimated_structure_graph('./result0.png') diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/codecov.yml @@ -0,0 +1 @@ + diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.doctree index 02326e4..6ba6774 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.estimators.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.estimators.doctree index 94d8438..3d2f991 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.estimators.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.estimators.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.optimizers.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.optimizers.doctree index a270618..fc9270a 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.optimizers.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.optimizers.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree index f6b233a..0b47057 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree index 508570a..164c20f 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.doctree b/docs-out/_build/doctrees/PyCTBN.doctree index e288803..dc97e78 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.doctree and b/docs-out/_build/doctrees/PyCTBN.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.tests.doctree b/docs-out/_build/doctrees/PyCTBN.tests.doctree index 207b2eb..a108437 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.tests.doctree and b/docs-out/_build/doctrees/PyCTBN.tests.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.tests.estimators.doctree b/docs-out/_build/doctrees/PyCTBN.tests.estimators.doctree index f9d7e6c..0616973 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.tests.estimators.doctree and b/docs-out/_build/doctrees/PyCTBN.tests.estimators.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.tests.optimizers.doctree b/docs-out/_build/doctrees/PyCTBN.tests.optimizers.doctree index e4799fb..299905e 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.tests.optimizers.doctree and b/docs-out/_build/doctrees/PyCTBN.tests.optimizers.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree b/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree index 645d24f..07fd39e 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree and b/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.tests.utility.doctree b/docs-out/_build/doctrees/PyCTBN.tests.utility.doctree index 56fcade..c8f358b 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.tests.utility.doctree and b/docs-out/_build/doctrees/PyCTBN.tests.utility.doctree differ diff --git a/docs-out/_build/doctrees/basic_main.doctree b/docs-out/_build/doctrees/basic_main.doctree index 20d3887..bf49862 100644 Binary files a/docs-out/_build/doctrees/basic_main.doctree and b/docs-out/_build/doctrees/basic_main.doctree differ diff --git a/docs-out/_build/doctrees/environment.pickle b/docs-out/_build/doctrees/environment.pickle index 73cc953..8c0b162 100644 Binary files a/docs-out/_build/doctrees/environment.pickle and b/docs-out/_build/doctrees/environment.pickle differ diff --git a/docs-out/_build/doctrees/examples.doctree b/docs-out/_build/doctrees/examples.doctree index b604806..72a32a6 100644 Binary files a/docs-out/_build/doctrees/examples.doctree and b/docs-out/_build/doctrees/examples.doctree differ diff --git a/docs-out/_build/doctrees/index.doctree b/docs-out/_build/doctrees/index.doctree index c5dcf41..ae88b93 100644 Binary files a/docs-out/_build/doctrees/index.doctree and b/docs-out/_build/doctrees/index.doctree differ diff --git a/docs-out/_build/doctrees/modules.doctree b/docs-out/_build/doctrees/modules.doctree index 03986fe..1338171 100644 Binary files a/docs-out/_build/doctrees/modules.doctree and b/docs-out/_build/doctrees/modules.doctree differ diff --git a/docs-out/_build/doctrees/setup.doctree b/docs-out/_build/doctrees/setup.doctree index c9b472d..785f8ca 100644 Binary files a/docs-out/_build/doctrees/setup.doctree and b/docs-out/_build/doctrees/setup.doctree differ diff --git a/docs-out/_build/html/.buildinfo b/docs-out/_build/html/.buildinfo index 7fb3e3f..bc64bd8 100644 --- a/docs-out/_build/html/.buildinfo +++ b/docs-out/_build/html/.buildinfo @@ -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: b22e9cd1b245962cc8b033cb6fcce1d2 +config: 481da5f157a263da657ebbabcd85e902 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs-out/_build/html/PyCTBN.PyCTBN.estimators.html b/docs-out/_build/html/PyCTBN.PyCTBN.estimators.html index b76ff0c..744c567 100644 --- a/docs-out/_build/html/PyCTBN.PyCTBN.estimators.html +++ b/docs-out/_build/html/PyCTBN.PyCTBN.estimators.html @@ -61,7 +61,7 @@ -

Contents:

+

Contents:

  • PyCTBN.PyCTBN package
    • Subpackages
    • @@ -115,12 +115,12 @@
      -
      +

      PyCTBN.PyCTBN.estimators package

      -
      +

      Submodules

      -
      -
      +
      +

      PyCTBN.PyCTBN.estimators.fam_score_calculator module

      @@ -300,8 +300,8 @@ and a specif parents’s assignment

      -
      -
      + +

      PyCTBN.PyCTBN.estimators.parameters_estimator module

      @@ -385,8 +385,8 @@ in the graph _net_g
      -
      -
      + +

      PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator module

      @@ -467,22 +467,34 @@ Generates all the necessary structures and datas to perform the tests.

      -ctpc_algorithm(disable_multiprocessing: bool = False)
      +ctpc_algorithm(disable_multiprocessing: bool = False, processes_number: int = None)

      Compute the CTPC algorithm over the entire net.

      +
      +
      Parameters
      +
        +
      • disable_multiprocessing (Boolean, optional) – true if you desire to disable the multiprocessing operations, default to False

      • +
      • processes_number – if disable_multiprocessing is false indicates

      • +
      +
      +
      +

      the maximum number of process; if None it will be automatically set, default to None +:type processes_number: int, optional

      -estimate_structure(disable_multiprocessing: bool = False)
      -

      Abstract method to estimate the structure

      +estimate_structure(disable_multiprocessing: bool = False, processes_number: int = None) +

      Compute the constraint-based algorithm to find the optimal structure

      -
      Returns
      -

      List of estimated edges

      -
      -
      Return type
      -

      Typing.List

      +
      Parameters
      +
        +
      • disable_multiprocessing (Boolean, optional) – true if you desire to disable the multiprocessing operations, default to False

      • +
      • processes_number – if disable_multiprocessing is false indicates

      • +
      +

      the maximum number of process; if None it will be automatically set, default to None +:type processes_number: int, optional

      @@ -521,8 +533,8 @@ it is performed also the chi_test.

      -
      -
      + +

      PyCTBN.PyCTBN.estimators.structure_estimator module

      @@ -636,8 +648,7 @@ that do not contains a the node identified by
      save_plot_estimated_structure_graph(file_path: str) → None
      -

      Plot the estimated structure in a graphical model style, use .png extension. -Spurious edges are colored in red if a prior structure is present.

      +

      Plot the estimated structure in a graphical model style, use .png extension.

      Parameters

      file_path – path to save the file to

      @@ -678,8 +689,8 @@ Spurious edges are colored in red if a prior structure is present.

      -
      -
      + +

      PyCTBN.PyCTBN.estimators.structure_score_based_estimator module

      @@ -724,7 +735,7 @@ using a score based approach and differt kinds of optimization algorithms.

      -estimate_structure(max_parents: int = None, iterations_number: int = 40, patience: int = None, tabu_length: int = None, tabu_rules_duration: int = None, optimizer: str = 'tabu', disable_multiprocessing: bool = False)
      +estimate_structure(max_parents: int = None, iterations_number: int = 40, patience: int = None, tabu_length: int = None, tabu_rules_duration: int = None, optimizer: str = 'tabu', disable_multiprocessing: bool = False, processes_number: int = None)

      Compute the score-based algorithm to find the optimal structure

      Parameters
      @@ -736,9 +747,12 @@ using a score based approach and differt kinds of optimization algorithms.

    • tabu_rules_duration (int, optional) – number of iterations in which each rule keeps its value, default to None

    • optimizer (string, optional) – name of the optimizer algorithm. Possible values: ‘hill’ (Hill climbing),’tabu’ (tabu search), defualt to ‘tabu’

    • disable_multiprocessing (Boolean, optional) – true if you desire to disable the multiprocessing operations, default to False

    • +
    • processes_number – if disable_multiprocessing is false indicates

    +

    the maximum number of process; if None it will be automatically set, default to None +:type processes_number: int, optional

    @@ -763,11 +777,11 @@ using a score based approach and differt kinds of optimization algorithms.

    - -
    + +

    Module contents

    -
    - + + diff --git a/docs-out/_build/html/PyCTBN.PyCTBN.html b/docs-out/_build/html/PyCTBN.PyCTBN.html index 6e4fde1..bd6313d 100644 --- a/docs-out/_build/html/PyCTBN.PyCTBN.html +++ b/docs-out/_build/html/PyCTBN.PyCTBN.html @@ -60,7 +60,7 @@ -

    Contents:

    +

    Contents:

    • PyCTBN.PyCTBN package
      • Subpackages
      • @@ -114,9 +114,9 @@
        -
        +

        PyCTBN.PyCTBN package

        -
        +

        Subpackages

          @@ -161,11 +161,11 @@
        -
        -
        +
        +

        Module contents

        -
        -
        + +
        diff --git a/docs-out/_build/html/PyCTBN.PyCTBN.optimizers.html b/docs-out/_build/html/PyCTBN.PyCTBN.optimizers.html index be9cd55..58423f2 100644 --- a/docs-out/_build/html/PyCTBN.PyCTBN.optimizers.html +++ b/docs-out/_build/html/PyCTBN.PyCTBN.optimizers.html @@ -61,7 +61,7 @@ -

        Contents:

        +

        Contents:

        • PyCTBN.PyCTBN package
          • Subpackages
          • @@ -115,12 +115,12 @@
            -
            +

            PyCTBN.PyCTBN.optimizers package

            -
            +

            Submodules

            -
            -
            +
            +

            PyCTBN.PyCTBN.optimizers.constraint_based_optimizer module

            @@ -152,8 +152,8 @@
            -
            - -
            + +

            PyCTBN.PyCTBN.optimizers.optimizer module

            @@ -219,8 +219,8 @@
            -
            - -
            + +

            Module contents

            -
            -
            + +
            diff --git a/docs-out/_build/html/PyCTBN.PyCTBN.structure_graph.html b/docs-out/_build/html/PyCTBN.PyCTBN.structure_graph.html index 6080755..9ff99e7 100644 --- a/docs-out/_build/html/PyCTBN.PyCTBN.structure_graph.html +++ b/docs-out/_build/html/PyCTBN.PyCTBN.structure_graph.html @@ -61,7 +61,7 @@ -

            Contents:

            +

            Contents:

            • PyCTBN.PyCTBN package
              • Subpackages
              • @@ -115,12 +115,12 @@
                -
                +

                PyCTBN.PyCTBN.structure_graph package

                -
                +

                Submodules

                -
                -
                +
                +

                PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module

                @@ -163,8 +163,8 @@ The class member _c
                -
                -
                + +

                PyCTBN.PyCTBN.structure_graph.network_graph module

                @@ -456,8 +456,8 @@ Initialize all the filtering/indexing structures.

                -
                -
                + +

                PyCTBN.PyCTBN.structure_graph.sample_path module

                @@ -520,8 +520,8 @@ Clears all the unused dataframes in <
                -
                -
                + +

                PyCTBN.PyCTBN.structure_graph.set_of_cims module

                @@ -606,8 +606,8 @@ Compute the cim coefficients.The class member +
                +

                PyCTBN.PyCTBN.structure_graph.structure module

                @@ -735,8 +735,8 @@ The class member _t
                -
                -
                + +

                PyCTBN.PyCTBN.structure_graph.trajectory module

                @@ -780,11 +780,11 @@ The class member _t
                -
                -
                + +

                Module contents

                -
                -
                + +
                diff --git a/docs-out/_build/html/PyCTBN.PyCTBN.utility.html b/docs-out/_build/html/PyCTBN.PyCTBN.utility.html index ba10218..50c6ce2 100644 --- a/docs-out/_build/html/PyCTBN.PyCTBN.utility.html +++ b/docs-out/_build/html/PyCTBN.PyCTBN.utility.html @@ -61,7 +61,7 @@ -

                Contents:

                +

                Contents:

                • PyCTBN.PyCTBN package
                  • Subpackages
                  • @@ -115,12 +115,12 @@
                    -
                    +

                    PyCTBN.PyCTBN.utility package

                    -
                    +

                    Submodules

                    -
                    -
                    +
                    +

                    PyCTBN.PyCTBN.utility.abstract_importer module

                    @@ -281,8 +281,8 @@ dataset

                    -
                    -
                    + +

                    PyCTBN.PyCTBN.utility.cache module

                    @@ -340,8 +340,8 @@ None otherwise.

                    -
                    -
                    + +

                    PyCTBN.PyCTBN.utility.json_importer module

                    @@ -391,11 +391,11 @@ dataset

                    -import_data(indx: int) → None
                    +import_data(indx: int = 0) → None

                    Implements the abstract method of AbstractImporter.

                    Parameters
                    -

                    indx (int) – the index of the outer JsonArray to extract the data from

                    +

                    indx (int) – the index of the outer JsonArray to extract the data from, default to 0

                    @@ -531,8 +531,8 @@ as keys for the set of CIMS of a particular node.

                    -
                    -
                    + +

                    PyCTBN.PyCTBN.utility.sample_importer module

                    @@ -575,11 +575,11 @@ dataset

                    -
                    -
                    + +

                    Module contents

                    -
                    -
                    + +
                    diff --git a/docs-out/_build/html/PyCTBN.html b/docs-out/_build/html/PyCTBN.html index 1faa738..8f6f17f 100644 --- a/docs-out/_build/html/PyCTBN.html +++ b/docs-out/_build/html/PyCTBN.html @@ -58,7 +58,7 @@ -

                    Contents:

                    +

                    Contents:

                    • PyCTBN.PyCTBN package
                      • Subpackages
                      • @@ -112,9 +112,9 @@
                        -
                        +

                        PyCTBN package

                        -
                        +

                        Subpackages

                          @@ -166,14 +166,14 @@
                        -
                        -
                        +
                        +

                        Submodules

                        -
                        -
                        + +

                        Module contents

                        -
                        -
                        + +
                        diff --git a/docs-out/_build/html/PyCTBN.tests.estimators.html b/docs-out/_build/html/PyCTBN.tests.estimators.html index ab1bfc8..8a63d1f 100644 --- a/docs-out/_build/html/PyCTBN.tests.estimators.html +++ b/docs-out/_build/html/PyCTBN.tests.estimators.html @@ -58,7 +58,7 @@ -

                        Contents:

                        +

                        Contents:

                        • PyCTBN.PyCTBN package
                          • Subpackages
                          • @@ -112,12 +112,12 @@
                            -
                            +

                            PyCTBN.tests.estimators package

                            -
                            +

                            Submodules

                            -
                            -
                            +
                            +

                            PyCTBN.tests.estimators.test_parameters_estimator module

                            @@ -156,8 +156,8 @@
                            -
                            -
                            + +

                            PyCTBN.tests.estimators.test_structure_constraint_based_estimator module

                            @@ -186,8 +186,8 @@
                            -
                            -
                            + +

                            PyCTBN.tests.estimators.test_structure_estimator module

                            @@ -241,8 +241,8 @@
                            -
                            -
                            + +

                            PyCTBN.tests.estimators.test_structure_score_based_estimator module

                            @@ -276,11 +276,11 @@
                            -
                            -
                            + +

                            Module contents

                            -
                            -
                            + +
                            diff --git a/docs-out/_build/html/PyCTBN.tests.html b/docs-out/_build/html/PyCTBN.tests.html index dc6280d..83be260 100644 --- a/docs-out/_build/html/PyCTBN.tests.html +++ b/docs-out/_build/html/PyCTBN.tests.html @@ -58,7 +58,7 @@ -

                            Contents:

                            +

                            Contents:

                            • PyCTBN.PyCTBN package
                              • Subpackages
                              • @@ -112,9 +112,9 @@
                                -
                                +

                                PyCTBN.tests package

                                -
                                +

                                Subpackages

                                  @@ -155,11 +155,11 @@
                                -
                                -
                                +
                                +

                                Module contents

                                -
                                -
                                + +
                                diff --git a/docs-out/_build/html/PyCTBN.tests.optimizers.html b/docs-out/_build/html/PyCTBN.tests.optimizers.html index 20e937a..96038cc 100644 --- a/docs-out/_build/html/PyCTBN.tests.optimizers.html +++ b/docs-out/_build/html/PyCTBN.tests.optimizers.html @@ -58,7 +58,7 @@ -

                                Contents:

                                +

                                Contents:

                                • PyCTBN.PyCTBN package
                                  • Subpackages
                                  • @@ -112,12 +112,12 @@
                                    -
                                    +

                                    PyCTBN.tests.optimizers package

                                    -
                                    +

                                    Submodules

                                    -
                                    -
                                    +
                                    - -
                                    + +

                                    Module contents

                                    -
                                    -
                                    + +
                                    diff --git a/docs-out/_build/html/PyCTBN.tests.structure_graph.html b/docs-out/_build/html/PyCTBN.tests.structure_graph.html index f87e7db..f3dae53 100644 --- a/docs-out/_build/html/PyCTBN.tests.structure_graph.html +++ b/docs-out/_build/html/PyCTBN.tests.structure_graph.html @@ -58,7 +58,7 @@ -

                                    Contents:

                                    +

                                    Contents:

                                    • PyCTBN.PyCTBN package
                                      • Subpackages
                                      • @@ -112,12 +112,12 @@
                                        -
                                        +

                                        PyCTBN.tests.structure_graph package

                                        -
                                        +

                                        Submodules

                                        -
                                        -
                                        +
                                        +

                                        PyCTBN.tests.structure_graph.test_cim module

                                        @@ -146,8 +146,8 @@
                                        -
                                        -
                                        + +

                                        PyCTBN.tests.structure_graph.test_networkgraph module

                                        @@ -251,8 +251,8 @@
                                        -
                                        -
                                        + +

                                        PyCTBN.tests.structure_graph.test_sample_path module

                                        @@ -311,8 +311,8 @@
                                        -
                                        -
                                        + +

                                        PyCTBN.tests.structure_graph.test_setofcims module

                                        @@ -368,8 +368,8 @@
                                        -
                                        -
                                        + +

                                        PyCTBN.tests.structure_graph.test_structure module

                                        @@ -423,8 +423,8 @@
                                        -
                                        -
                                        + +

                                        PyCTBN.tests.structure_graph.test_trajectory module

                                        @@ -443,11 +443,11 @@
                                        -
                                        -
                                        + +

                                        Module contents

                                        -
                                        -
                                        + +
                                        diff --git a/docs-out/_build/html/PyCTBN.tests.utility.html b/docs-out/_build/html/PyCTBN.tests.utility.html index 0cd5380..606ce71 100644 --- a/docs-out/_build/html/PyCTBN.tests.utility.html +++ b/docs-out/_build/html/PyCTBN.tests.utility.html @@ -58,7 +58,7 @@ -

                                        Contents:

                                        +

                                        Contents:

                                        • PyCTBN.PyCTBN package
                                          • Subpackages
                                          • @@ -112,12 +112,12 @@
                                            -
                                            +

                                            PyCTBN.tests.utility package

                                            -
                                            +

                                            Submodules

                                            -
                                            -
                                            +
                                            +

                                            PyCTBN.tests.utility.test_cache module

                                            @@ -145,8 +145,8 @@
                                            -
                                            -
                                            + +

                                            PyCTBN.tests.utility.test_json_importer module

                                            @@ -255,8 +255,8 @@
                                            -
                                            -
                                            + +

                                            PyCTBN.tests.utility.test_sample_importer module

                                            @@ -285,11 +285,11 @@
                                            -
                                            -
                                            + +

                                            Module contents

                                            -
                                            -
                                            + +
                                            diff --git a/docs-out/_build/html/_sources/examples.rst.txt b/docs-out/_build/html/_sources/examples.rst.txt index b1e07c5..5386451 100644 --- a/docs-out/_build/html/_sources/examples.rst.txt +++ b/docs-out/_build/html/_sources/examples.rst.txt @@ -3,9 +3,9 @@ Examples Installation/Usage ****************** -Download the release in .tar.gz or .whl format and simply use pip install to install it:: +Download the latest release in .tar.gz or .whl format and simply use pip install to install it:: - $pip install PyCTBN-1.0.tar.gz + $pip install PyCTBN-2.2.tar.gz Implementing your own data importer diff --git a/docs-out/_build/html/basic_main.html b/docs-out/_build/html/basic_main.html index 1ba75f4..a74fa74 100644 --- a/docs-out/_build/html/basic_main.html +++ b/docs-out/_build/html/basic_main.html @@ -58,7 +58,7 @@ -

                                            Contents:

                                            +

                                            Contents:

                                            • PyCTBN.PyCTBN package
                                              • Subpackages
                                              • @@ -112,9 +112,9 @@
                                                -
                                                +

                                                basic_main module

                                                -
                                                +
                                                diff --git a/docs-out/_build/html/examples.html b/docs-out/_build/html/examples.html index 8bf8f53..2755cf0 100644 --- a/docs-out/_build/html/examples.html +++ b/docs-out/_build/html/examples.html @@ -59,7 +59,7 @@ -

                                                Contents:

                                                +

                                                Contents:

                                                • PyCTBN.PyCTBN package
                                                  • Subpackages
                                                  • @@ -113,16 +113,16 @@
                                                    -
                                                    +

                                                    Examples

                                                    -
                                                    +

                                                    Installation/Usage

                                                    -

                                                    Download the release in .tar.gz or .whl format and simply use pip install to install it:

                                                    -
                                                    $pip install PyCTBN-1.0.tar.gz
                                                    +

                                                    Download the latest release in .tar.gz or .whl format and simply use pip install to install it:

                                                    +
                                                    $pip install PyCTBN-2.2.tar.gz
                                                     
                                                    -
                                                    -
                                                    +
                                                    +

                                                    Implementing your own data importer

                                                    """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 and no prior net structure.
                                                    @@ -161,8 +161,8 @@
                                                             pass
                                                     
                                                    -
                                                    -
                                                    +
                                                    +

                                                    Parameters Estimation Example

                                                    from PyCTBN import JsonImporter
                                                     from PyCTBN import SamplePath
                                                    @@ -199,8 +199,8 @@
                                                         print(sofc1.actual_cims)
                                                     
                                                    -
                                                    -
                                                    + +

                                                    Structure Estimation Example

                                                    from PyCTBN import JsonImporter
                                                     from PyCTBN import SamplePath
                                                    @@ -230,8 +230,8 @@
                                                         se1.save_results()
                                                     
                                                    -
                                                    -
                                                    + +
                                                    diff --git a/docs-out/_build/html/genindex.html b/docs-out/_build/html/genindex.html index 0dea95f..bd2996c 100644 --- a/docs-out/_build/html/genindex.html +++ b/docs-out/_build/html/genindex.html @@ -58,7 +58,7 @@ -

                                                    Contents:

                                                    +

                                                    Contents:

                                                    • PyCTBN.PyCTBN package
                                                      • Subpackages
                                                      • diff --git a/docs-out/_build/html/index.html b/docs-out/_build/html/index.html index f262fe7..996979e 100644 --- a/docs-out/_build/html/index.html +++ b/docs-out/_build/html/index.html @@ -59,7 +59,7 @@ -

                                                        Contents:

                                                        +

                                                        Contents:

                                                        • PyCTBN.PyCTBN package
                                                          • Subpackages
                                                          • @@ -113,10 +113,10 @@
                                                            -
                                                            +

                                                            Welcome to PyCTBN’s documentation!

                                                            -

                                                            Contents:

                                                            +

                                                            Contents:

                                                            -
                                                            -
                                                            + +

                                                            Indices and tables

                                                            -
                                                            +
                                                            diff --git a/docs-out/_build/html/modules.html b/docs-out/_build/html/modules.html index 28d3d3b..2540d43 100644 --- a/docs-out/_build/html/modules.html +++ b/docs-out/_build/html/modules.html @@ -58,7 +58,7 @@ -

                                                            Contents:

                                                            +

                                                            Contents:

                                                            • PyCTBN.PyCTBN package
                                                              • Subpackages
                                                              • @@ -112,7 +112,7 @@
                                                                -
                                                                +

                                                                PyCTBN

                                                                  @@ -171,7 +171,7 @@
                                                                -
                                                                +
                                                                diff --git a/docs-out/_build/html/py-modindex.html b/docs-out/_build/html/py-modindex.html index 809febd..d729367 100644 --- a/docs-out/_build/html/py-modindex.html +++ b/docs-out/_build/html/py-modindex.html @@ -61,7 +61,7 @@ -

                                                                Contents:

                                                                +

                                                                Contents:

                                                                • PyCTBN.PyCTBN package
                                                                  • Subpackages
                                                                  • diff --git a/docs-out/_build/html/search.html b/docs-out/_build/html/search.html index b9884b3..21fd6c9 100644 --- a/docs-out/_build/html/search.html +++ b/docs-out/_build/html/search.html @@ -58,7 +58,7 @@ -

                                                                    Contents:

                                                                    +

                                                                    Contents:

                                                                    • PyCTBN.PyCTBN package
                                                                      • Subpackages
                                                                      • diff --git a/docs-out/_build/html/searchindex.js b/docs-out/_build/html/searchindex.js index c34509d..22a6a83 100644 --- a/docs-out/_build/html/searchindex.js +++ b/docs-out/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["PyCTBN","PyCTBN.PyCTBN","PyCTBN.PyCTBN.estimators","PyCTBN.PyCTBN.optimizers","PyCTBN.PyCTBN.structure_graph","PyCTBN.PyCTBN.utility","PyCTBN.tests","PyCTBN.tests.estimators","PyCTBN.tests.optimizers","PyCTBN.tests.structure_graph","PyCTBN.tests.utility","basic_main","examples","index","modules","setup"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["PyCTBN.rst","PyCTBN.PyCTBN.rst","PyCTBN.PyCTBN.estimators.rst","PyCTBN.PyCTBN.optimizers.rst","PyCTBN.PyCTBN.structure_graph.rst","PyCTBN.PyCTBN.utility.rst","PyCTBN.tests.rst","PyCTBN.tests.estimators.rst","PyCTBN.tests.optimizers.rst","PyCTBN.tests.structure_graph.rst","PyCTBN.tests.utility.rst","basic_main.rst","examples.rst","index.rst","modules.rst","setup.rst"],objects:{"":{PyCTBN:[0,0,0,"-"]},"PyCTBN.PyCTBN":{estimators:[2,0,0,"-"],optimizers:[3,0,0,"-"],structure_graph:[4,0,0,"-"],utility:[5,0,0,"-"]},"PyCTBN.PyCTBN.estimators":{fam_score_calculator:[2,0,0,"-"],parameters_estimator:[2,0,0,"-"],structure_constraint_based_estimator:[2,0,0,"-"],structure_estimator:[2,0,0,"-"],structure_score_based_estimator:[2,0,0,"-"]},"PyCTBN.PyCTBN.estimators.fam_score_calculator":{FamScoreCalculator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.fam_score_calculator.FamScoreCalculator":{get_fam_score:[2,2,1,""],marginal_likelihood_q:[2,2,1,""],marginal_likelihood_theta:[2,2,1,""],single_cim_xu_marginal_likelihood_q:[2,2,1,""],single_cim_xu_marginal_likelihood_theta:[2,2,1,""],single_internal_cim_xxu_marginal_likelihood_theta:[2,2,1,""],variable_cim_xu_marginal_likelihood_q:[2,2,1,""],variable_cim_xu_marginal_likelihood_theta:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator":{ParametersEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[2,2,1,""],compute_state_res_time_for_node:[2,2,1,""],compute_state_transitions_for_a_node:[2,2,1,""],fast_init:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator":{StructureConstraintBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator":{complete_test:[2,2,1,""],compute_thumb_value:[2,2,1,""],ctpc_algorithm:[2,2,1,""],estimate_structure:[2,2,1,""],independence_test:[2,2,1,""],one_iteration_of_CTPC_algorithm:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator":{StructureEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator":{adjacency_matrix:[2,2,1,""],build_complete_graph:[2,2,1,""],build_removable_edges_matrix:[2,2,1,""],estimate_structure:[2,2,1,""],generate_possible_sub_sets_of_size:[2,2,1,""],save_plot_estimated_structure_graph:[2,2,1,""],save_results:[2,2,1,""],spurious_edges:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator":{StructureScoreBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator":{estimate_parents:[2,2,1,""],estimate_structure:[2,2,1,""],get_score_from_graph:[2,2,1,""]},"PyCTBN.PyCTBN.optimizers":{constraint_based_optimizer:[3,0,0,"-"],hill_climbing_search:[3,0,0,"-"],optimizer:[3,0,0,"-"],tabu_search:[3,0,0,"-"]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer":{ConstraintBasedOptimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search":{HillClimbing:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer":{Optimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer.Optimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search":{TabuSearch:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.structure_graph":{conditional_intensity_matrix:[4,0,0,"-"],network_graph:[4,0,0,"-"],sample_path:[4,0,0,"-"],set_of_cims:[4,0,0,"-"],structure:[4,0,0,"-"],trajectory:[4,0,0,"-"]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix":{ConditionalIntensityMatrix:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[4,2,1,""],compute_cim_coefficients:[4,2,1,""],state_residence_times:[4,2,1,""],state_transition_matrix:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph":{NetworkGraph:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph":{add_edges:[4,2,1,""],add_nodes:[4,2,1,""],build_p_comb_structure_for_a_node:[4,2,1,""],build_time_columns_filtering_for_a_node:[4,2,1,""],build_time_scalar_indexing_structure_for_a_node:[4,2,1,""],build_transition_filtering_for_a_node:[4,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[4,2,1,""],clear_indexing_filtering_structures:[4,2,1,""],edges:[4,2,1,""],fast_init:[4,2,1,""],get_node_indx:[4,2,1,""],get_ordered_by_indx_set_of_parents:[4,2,1,""],get_parents_by_id:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],has_edge:[4,2,1,""],nodes:[4,2,1,""],nodes_indexes:[4,2,1,""],nodes_values:[4,2,1,""],p_combs:[4,2,1,""],remove_edges:[4,2,1,""],remove_node:[4,2,1,""],time_filtering:[4,2,1,""],time_scalar_indexing_strucure:[4,2,1,""],transition_filtering:[4,2,1,""],transition_scalar_indexing_structure:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path":{SamplePath:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath":{build_structure:[4,2,1,""],build_trajectories:[4,2,1,""],clear_memory:[4,2,1,""],has_prior_net_structure:[4,2,1,""],structure:[4,2,1,""],total_variables_count:[4,2,1,""],trajectories:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims":{SetOfCims:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims":{actual_cims:[4,2,1,""],build_cims:[4,2,1,""],build_times_and_transitions_structures:[4,2,1,""],filter_cims_with_mask:[4,2,1,""],get_cims_number:[4,2,1,""],p_combs:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.structure":{Structure:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.structure.Structure":{add_edge:[4,2,1,""],clean_structure_edges:[4,2,1,""],contains_edge:[4,2,1,""],edges:[4,2,1,""],get_node_id:[4,2,1,""],get_node_indx:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],nodes_indexes:[4,2,1,""],nodes_labels:[4,2,1,""],nodes_values:[4,2,1,""],remove_edge:[4,2,1,""],remove_node:[4,2,1,""],total_variables_number:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory":{Trajectory:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory":{complete_trajectory:[4,2,1,""],size:[4,2,1,""],times:[4,2,1,""],trajectory:[4,2,1,""]},"PyCTBN.PyCTBN.utility":{abstract_importer:[5,0,0,"-"],cache:[5,0,0,"-"],json_importer:[5,0,0,"-"],sample_importer:[5,0,0,"-"]},"PyCTBN.PyCTBN.utility.abstract_importer":{AbstractImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter":{build_list_of_samples_array:[5,2,1,""],build_sorter:[5,2,1,""],clear_concatenated_frame:[5,2,1,""],compute_row_delta_in_all_samples_frames:[5,2,1,""],compute_row_delta_sigle_samples_frame:[5,2,1,""],concatenated_samples:[5,2,1,""],dataset_id:[5,2,1,""],file_path:[5,2,1,""],sorter:[5,2,1,""],structure:[5,2,1,""],variables:[5,2,1,""]},"PyCTBN.PyCTBN.utility.cache":{Cache:[5,1,1,""]},"PyCTBN.PyCTBN.utility.cache.Cache":{clear:[5,2,1,""],find:[5,2,1,""],put:[5,2,1,""]},"PyCTBN.PyCTBN.utility.json_importer":{JsonImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.json_importer.JsonImporter":{build_sorter:[5,2,1,""],clear_data_frame_list:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""],import_sampled_cims:[5,2,1,""],import_structure:[5,2,1,""],import_trajectories:[5,2,1,""],import_variables:[5,2,1,""],normalize_trajectories:[5,2,1,""],one_level_normalizing:[5,2,1,""],read_json_file:[5,2,1,""]},"PyCTBN.PyCTBN.utility.sample_importer":{SampleImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.sample_importer.SampleImporter":{build_sorter:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""]},"PyCTBN.tests":{estimators:[7,0,0,"-"],optimizers:[8,0,0,"-"],structure_graph:[9,0,0,"-"],utility:[10,0,0,"-"]},"PyCTBN.tests.estimators":{test_parameters_estimator:[7,0,0,"-"],test_structure_constraint_based_estimator:[7,0,0,"-"],test_structure_estimator:[7,0,0,"-"],test_structure_score_based_estimator:[7,0,0,"-"]},"PyCTBN.tests.estimators.test_parameters_estimator":{TestParametersEstimatior:[7,1,1,""]},"PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior":{aux_import_sampled_cims:[7,2,1,""],cim_equality_test:[7,2,1,""],equality_of_cims_of_node:[7,2,1,""],setUpClass:[7,2,1,""],test_compute_parameters_for_node:[7,2,1,""],test_fast_init:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_constraint_based_estimator":{TestStructureConstraintBasedEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_constraint_based_estimator.TestStructureConstraintBasedEstimator":{setUpClass:[7,2,1,""],test_structure_1:[7,2,1,""],test_structure_2:[7,2,1,""],test_structure_3:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_estimator":{TestStructureEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator":{setUpClass:[7,2,1,""],test_adjacency_matrix:[7,2,1,""],test_build_complete_graph:[7,2,1,""],test_build_removable_edges_matrix:[7,2,1,""],test_generate_possible_sub_sets_of_size:[7,2,1,""],test_init:[7,2,1,""],test_save_plot_estimated_graph:[7,2,1,""],test_save_results:[7,2,1,""],test_time:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_score_based_estimator":{TestStructureScoreBasedEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_score_based_estimator.TestStructureScoreBasedEstimator":{setUpClass:[7,2,1,""],test_structure_1:[7,2,1,""],test_structure_2:[7,2,1,""],test_structure_3:[7,2,1,""],test_structure_monoprocesso:[7,2,1,""]},"PyCTBN.tests.optimizers":{test_hill_climbing_search:[8,0,0,"-"],test_tabu_search:[8,0,0,"-"]},"PyCTBN.tests.optimizers.test_hill_climbing_search":{TestHillClimbingSearch:[8,1,1,""]},"PyCTBN.tests.optimizers.test_hill_climbing_search.TestHillClimbingSearch":{setUpClass:[8,2,1,""],test_structure:[8,2,1,""],test_structure_3:[8,2,1,""]},"PyCTBN.tests.optimizers.test_tabu_search":{TestTabuSearch:[8,1,1,""]},"PyCTBN.tests.optimizers.test_tabu_search.TestTabuSearch":{setUpClass:[8,2,1,""],test_structure:[8,2,1,""],test_structure_3:[8,2,1,""]},"PyCTBN.tests.structure_graph":{test_cim:[9,0,0,"-"],test_networkgraph:[9,0,0,"-"],test_sample_path:[9,0,0,"-"],test_setofcims:[9,0,0,"-"],test_structure:[9,0,0,"-"],test_trajectory:[9,0,0,"-"]},"PyCTBN.tests.structure_graph.test_cim":{TestConditionalIntensityMatrix:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_cim.TestConditionalIntensityMatrix":{setUpClass:[9,2,1,""],test_compute_cim_coefficients:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph":{TestNetworkGraph:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph.TestNetworkGraph":{aux_build_p_combs_structure:[9,2,1,""],aux_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],aux_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],aux_build_transition_columns_filtering_structure:[9,2,1,""],aux_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_add_edges:[9,2,1,""],test_add_nodes:[9,2,1,""],test_build_p_combs_structure:[9,2,1,""],test_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],test_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],test_build_transition_columns_filtering_structure:[9,2,1,""],test_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],test_fast_init:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_ordered_by_indx_set_of_parents:[9,2,1,""],test_get_parents_by_id:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_sample_path":{TestSamplePath:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_sample_path.TestSamplePath":{setUpClass:[9,2,1,""],test_buid_samplepath_no_concatenated_samples:[9,2,1,""],test_buid_samplepath_no_variables:[9,2,1,""],test_build_saplepath_no_prior_net_structure:[9,2,1,""],test_build_structure:[9,2,1,""],test_build_structure_bad_sorter:[9,2,1,""],test_build_trajectories:[9,2,1,""],test_init:[9,2,1,""],test_init_not_filled_dataframse:[9,2,1,""],test_init_not_initialized_importer:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_setofcims":{TestSetOfCims:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_setofcims.TestSetOfCims":{another_filtering_method:[9,2,1,""],aux_test_build_cims:[9,2,1,""],aux_test_init:[9,2,1,""],build_p_comb_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_build_cims:[9,2,1,""],test_filter_cims_with_mask:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_structure":{TestStructure:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_structure.TestStructure":{setUpClass:[9,2,1,""],test_edges_operations:[9,2,1,""],test_equality:[9,2,1,""],test_get_node_id:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_positional_node_indx:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_trajectory":{TestTrajectory:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_trajectory.TestTrajectory":{setUpClass:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.utility":{test_cache:[10,0,0,"-"],test_json_importer:[10,0,0,"-"],test_sample_importer:[10,0,0,"-"]},"PyCTBN.tests.utility.test_cache":{TestCache:[10,1,1,""]},"PyCTBN.tests.utility.test_cache.TestCache":{test_clear:[10,2,1,""],test_find:[10,2,1,""],test_init:[10,2,1,""],test_put:[10,2,1,""]},"PyCTBN.tests.utility.test_json_importer":{TestJsonImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_json_importer.TestJsonImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_build_sorter:[10,2,1,""],test_clear_concatenated_frame:[10,2,1,""],test_clear_data_frame_list:[10,2,1,""],test_compute_row_delta_in_all_frames:[10,2,1,""],test_compute_row_delta_in_all_frames_not_init_sorter:[10,2,1,""],test_compute_row_delta_single_samples_frame:[10,2,1,""],test_dataset_id:[10,2,1,""],test_file_path:[10,2,1,""],test_import_data:[10,2,1,""],test_import_sampled_cims:[10,2,1,""],test_import_structure:[10,2,1,""],test_import_variables:[10,2,1,""],test_init:[10,2,1,""],test_normalize_trajectories:[10,2,1,""],test_normalize_trajectories_wrong_indx:[10,2,1,""],test_normalize_trajectories_wrong_key:[10,2,1,""],test_read_json_file_found:[10,2,1,""],test_read_json_file_not_found:[10,2,1,""]},"PyCTBN.tests.utility.test_sample_importer":{TestSampleImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_sample_importer.TestSampleImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_init:[10,2,1,""],test_order:[10,2,1,""]},PyCTBN:{PyCTBN:[1,0,0,"-"],tests:[6,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"abstract":[2,3,4,5,12],"boolean":[2,4],"case":[7,8,9,10],"class":[2,3,4,5,7,8,9,10,12],"default":[2,3],"float":2,"function":2,"import":[4,5,13,14],"int":[2,3,4,5],"null":2,"return":[2,3,4,5,9,12],"static":[2,4],"super":12,"true":[2,12],"var":12,HAS:5,Has:[2,4],NOT:2,The:[2,4,5,12],Use:[2,12],__actual_cach:5,__init__:12,__list_of_sets_of_par:5,_actual_cim:4,_actual_trajectori:4,_aggregated_info_about_nodes_par:4,_array_indx:5,_cach:2,_cim:4,_complete_graph:2,_df_samples_list:[5,12],_df_structur:5,_df_variabl:[5,12],_file_path:12,_graph:[4,12],_import:4,_net_graph:2,_node:2,_node_id:4,_nodes_indx:2,_nodes_v:2,_p_combs_structur:4,_raw_data:5,_sample_path:2,_single_set_of_cim:2,_sorter:[5,12],_state_residence_tim:4,_structur:4,_structure_label:5,_time:4,_time_filt:4,_time_scalar_indexing_structur:4,_total_variables_count:4,_total_variables_numb:4,_trajectori:4,_transition_filt:4,_transition_matric:4,_transition_scalar_indexing_structur:4,_variables_label:5,abc:[3,5],about:[3,4],abstract_import:[0,1,4,13,14],abstractimport:[4,5,12],act:5,actual:[2,4],actual_cim:[4,12],add:[4,5],add_edg:4,add_nod:4,added:2,addit:2,adjac:[2,12],adjacency_matrix:[2,12],after:5,against:2,aggreg:4,algorithm:[2,3,12],all:[2,3,4,5,9,12],alpha_xu:2,alpha_xxu:2,alreadi:[5,12],also:[2,4],ani:[2,3],anoth:4,another_filtering_method:9,approach:2,arc:5,arrai:[2,4,5,12],assign:2,assum:2,aux_build_p_combs_structur:9,aux_build_time_columns_filtering_structure_for_a_nod:9,aux_build_time_scalar_indexing_structure_for_a_nod:9,aux_build_transition_columns_filtering_structur:9,aux_build_transition_scalar_indexing_structure_for_a_nod:9,aux_import_sampled_cim:7,aux_test_build_cim:9,aux_test_init:9,axi:12,base:[2,3,4,5,7,8,9,10],bayesian:2,befor:[2,3,7,8,9,10],belong:2,best:2,between:5,bool:[2,4],both:[2,5],bound:4,build:[2,4,5,9,12],build_cim:4,build_complete_graph:2,build_list_of_samples_arrai:5,build_p_comb_structure_for_a_nod:[4,9],build_removable_edges_matrix:2,build_sort:[5,12],build_structur:[4,12],build_time_columns_filtering_for_a_nod:4,build_time_scalar_indexing_structure_for_a_nod:4,build_times_and_transitions_structur:4,build_trajectori:[4,12],build_transition_filtering_for_a_nod:4,build_transition_scalar_indexing_structure_for_a_nod:4,built:2,cach:[0,1,2,13,14],calcul:2,call:[5,12],cardin:[2,4,5,9],cardinalit:[4,5],caridin:4,caridinalit:4,chang:[4,5],check:4,chi:2,chi_test:2,chi_test_alfa:2,child:[2,3],child_indx:2,child_states_numb:2,child_val:2,cim1:[2,7],cim2:[2,7],cim:[2,4,5,12],cim_equality_test:7,cims_kei:5,cims_label:7,classmethod:[7,8,9,10],clean_structure_edg:4,clear:[4,5],clear_concatenated_fram:5,clear_data_frame_list:5,clear_indexing_filtering_structur:4,clear_memori:4,climb:[2,3],coeffici:4,col:4,color:2,cols_filt:2,column:[2,4,5,12],columns_head:5,comb:4,combin:[4,5,9],combinatori:[4,9],common:2,complet:[2,4,5],complete_test:2,complete_trajectori:4,comput:[2,3,4,5,12],compute_cim_coeffici:4,compute_parameters_for_nod:[2,12],compute_row_delta_in_all_samples_fram:[5,12],compute_row_delta_sigle_samples_fram:5,compute_state_res_time_for_nod:2,compute_state_transitions_for_a_nod:2,compute_thumb_valu:2,concatanated_sampl:5,concaten:[4,5],concatenated_sampl:5,condit:4,conditional_intensity_matrix:[0,1,2,13,14],conditionalintensitymatrix:[2,4],consid:[2,4],constraint:2,constraint_based_optim:[0,1,13,14],constraintbasedoptim:3,construct:[4,5,12],conta:5,contain:[2,4,5,9],contains_edg:4,content:[13,14],convert:[2,5],copi:5,core:5,correct:[4,5],could:2,count:4,creat:[2,4,12],csv:12,csvimport:12,ctbn:2,ctpc:[2,3,12],ctpc_algorithm:[2,12],current:[2,3,5],cut:5,dafram:5,data:[2,3,4,5,13,14],datafram:[4,5,12],dataset:[3,4,5],dataset_id:[5,12],datfram:5,def:12,defin:5,definit:5,defualt:2,delta:[2,4,5],demonstr:12,describ:5,desir:[2,4],df_samples_list:5,dict:[5,12],dictionari:5,differ:5,differt:2,digraph:2,dimens:4,dir:12,direct:[2,4],directli:5,disabl:[2,3],disable_multiprocess:2,distribuit:2,doc:5,doubl:4,download:12,drop:12,duplic:4,dyn:12,each:[2,3,5],edg:[2,4,5,12],edges_list:4,end:5,entir:2,equal:4,equality_of_cims_of_nod:7,est:12,estim:[0,1,3,4,6,13,14],estimate_par:2,estimate_structur:2,estimated_cim:7,everi:[4,5],exam:12,exampl:[5,13,14],exclud:2,exctract:5,exist:5,exp_test_alfa:2,exponenti:2,expos:5,extend:12,extens:[2,5],extract:[4,5],fals:2,fam_score_calcul:[0,1,13,14],famscor:2,famscorecalcul:2,fast_init:[2,4,12],file:[2,5,12],file_path:[2,5,12],filepath:5,fill:[2,12],filter:[2,4],filter_cims_with_mask:4,find:[2,5],first:[2,12],fixtur:[7,8,9,10],follow:[4,5],form:4,format:12,formula:2,found:5,frame:5,from:[4,5,12],from_nod:5,gener:2,generate_possible_sub_sets_of_s:2,get:[2,5],get_cims_numb:4,get_fam_scor:2,get_node_id:4,get_node_indx:4,get_ordered_by_indx_set_of_par:4,get_parents_by_id:4,get_positional_node_indx:4,get_score_from_graph:2,get_states_numb:4,given:[2,4,5],glob:12,graph:[2,4,9,12],graph_struct:4,graphic:2,grid:[4,9],grpah:12,has:[5,12],has_edg:4,has_prior_net_structur:4,have:5,header:5,header_column:5,hill:[2,3],hill_climbing_search:[0,1,13,14],hillclimb:3,hold:[2,4],hook:[7,8,9,10],how:5,hyperparamet:2,hypothesi:2,identifi:[2,4,5],iff:2,implement:[3,5,13,14],import_data:[5,12],import_sampled_cim:5,import_structur:5,import_trajectori:5,import_vari:[5,12],improv:[2,3],includ:2,independ:2,independence_test:2,index:[2,4,5,12,13],indic:4,indx:5,info:[4,12],inform:[3,4],init:12,initi:[2,4,5,12],inplac:12,insid:12,instal:[13,14],interest:4,interfac:3,intes:4,iter:[2,3],iterations_numb:[2,3],its:[2,3],join:12,json:[2,5,12],json_import:[0,1,13,14],jsonarrai:5,jsonimport:[5,12],keep:[2,3,5],kei:5,kind:2,knowledg:2,known:2,known_edg:2,label:[2,3,4,5],lenght:[2,3],level:[2,5],likelihood:2,list:[2,3,4,5,12],list_of_column:4,list_of_edg:4,list_of_nod:4,load:5,loop:2,m_xu_suff_stat:2,m_xxu_suff_stat:2,main:12,margin:2,marginal_likelihood_q:2,marginal_likelihood_theta:2,mask:[4,9],mask_arr:4,matric:[2,4],matrix:[2,4,5,9,12],max_par:[2,3],maximum:[2,3],member:[4,5],mention:4,merg:5,method:[2,5,7,8,9,10],methodnam:[7,8,9,10],model:2,modul:[13,14],multipl:5,multiprocess:2,name:[2,4,5,12],ndarrai:[2,4,5],necessari:[2,4,5],nest:5,net:[2,3,4,5,12],net_graph:2,network:[2,4,5],network_graph:[0,1,2,13,14],networkgraph:[2,4,12],networkx:2,node:[2,3,4,5,9,12],node_id:[2,3,4,9],node_index:4,node_indx:[2,4],node_st:[4,9],node_states_numb:[4,9],nodes_index:4,nodes_indexes_arr:4,nodes_label:4,nodes_labels_list:4,nodes_numb:4,nodes_vals_arr:4,nodes_valu:[4,12],none:[2,3,4,5,7,9,10,12],normal:5,normalize_trajectori:5,number:[2,3,4],numpi:[2,4,5,9],obj:[10,12],object:[2,3,4,5,12],one:[4,5],one_iteration_of_ctpc_algorithm:2,one_level_norm:5,onli:5,oper:2,optim:[0,1,2,6,13,14],optimize_structur:3,option:[2,3],order:[2,5,10],origin:5,original_cols_numb:4,otherwis:[2,5],out:5,outer:[5,12],over:2,own:[13,14],p_comb:[4,9],p_indx:[4,9],p_val:9,p_valu:9,packag:[13,14],page:13,panda:[5,12],param:4,paramet:[2,3,4,5,9,13,14],parameters_estim:[0,1,13,14],parametersestim:[2,12],parent:[2,3,4,5],parent_indx:2,parent_label:2,parent_set:2,parent_set_v:2,parent_v:2,parent_valu:9,parents_cardin:4,parents_comb:5,parents_index:4,parents_indx:9,parents_label:[4,9],parents_states_numb:[4,9],parents_v:[4,9],parents_valu:[4,9],part:2,particular:[2,5],pass:12,path:[2,5,12],patienc:[2,3],peest:12,perform:2,pip:12,place:5,plot:2,png:2,posit:[4,5],possibl:[2,4],predict:3,prepar:5,present:[2,5],print:12,prior:[2,12],prior_net_structur:5,process:[2,3,4,5],properli:5,properti:[4,5],put:5,pyctbn:12,q_xx:4,rappres:4,raw:5,raw_data:5,read:[5,12],read_csv:12,read_csv_fil:12,read_fil:12,read_json_fil:5,real:[2,4,5,12],red:2,refer:[4,5],reject:2,rel:4,relat:5,releas:12,remain:5,remov:[2,4,5],remove_edg:4,remove_nod:4,repres:4,represent:2,res:4,resid:[2,4],result:[2,5,12],rtype:4,rule:[2,3],run:[7,8,9,10],runtest:[7,8,9,10],same:5,sampl:[4,5,12],sample_fram:[5,12],sample_import:[0,1,13,14],sample_path:[0,1,2,13,14],sampled_cim:7,sampleimport:5,samplepath:[2,4,12],samples_label:5,save:[2,12],save_plot_estimated_structure_graph:2,save_result:[2,12],scalar_index:2,scalar_indexes_struct:2,score:2,se1:12,search:[2,3,13],second:2,see:5,select:12,self:[2,5,12],sep:2,sep_set:2,set:[2,4,5,7,8,9,10],set_of_cim:[0,1,2,5,13,14],setofcim:[2,4,5,12],setupclass:[7,8,9,10],shift:[4,5],shifted_cols_head:5,show:2,signific:2,simbol:5,simpl:12,simpli:12,sinc:4,single_cim_xu_marginal_likelihood_q:2,single_cim_xu_marginal_likelihood_theta:2,single_internal_cim_xxu_marginal_likelihood_theta:2,size:[2,4],socim:5,sofc1:12,sorter:5,specif:[2,4,12],spuriou:2,spurious_edg:2,start:5,state:[2,4],state_res_tim:4,state_residence_tim:4,state_transition_matrix:4,statist:2,stop:[2,3],str:[2,3,4,5,12],string:[2,3,4,5],structur:[0,1,2,3,5,9,13,14],structure_constraint_based_estim:[0,1,13,14],structure_estim:[0,1,3,13,14],structure_estimation_exampl:12,structure_graph:[0,1,2,5,6,13,14],structure_label:5,structure_score_based_estim:[0,1,13,14],structureconstraintbasedestim:2,structureestim:[2,3,12],structurescorebasedestim:2,structut:4,style:2,submodul:[1,6,13,14],subpackag:[13,14],subset:2,suffici:2,suffuci:2,symbol:[4,5],synthet:5,t_xu_suff_stat:2,tabu:[2,3],tabu_length:[2,3],tabu_rules_dur:[2,3],tabu_search:[0,1,13,14],tabusearch:3,take:12,tar:12,task:[2,4],tau_xu:2,ternari:12,test:2,test_add_edg:9,test_add_nod:9,test_adjacency_matrix:7,test_buid_samplepath_no_concatenated_sampl:9,test_buid_samplepath_no_vari:9,test_build_cim:9,test_build_complete_graph:7,test_build_p_combs_structur:9,test_build_removable_edges_matrix:7,test_build_saplepath_no_prior_net_structur:9,test_build_sort:10,test_build_structur:9,test_build_structure_bad_sort:9,test_build_time_columns_filtering_structure_for_a_nod:9,test_build_time_scalar_indexing_structure_for_a_nod:9,test_build_trajectori:9,test_build_transition_columns_filtering_structur:9,test_build_transition_scalar_indexing_structure_for_a_nod:9,test_cach:6,test_child:2,test_cim:6,test_clear:10,test_clear_concatenated_fram:10,test_clear_data_frame_list:10,test_compute_cim_coeffici:9,test_compute_parameters_for_nod:7,test_compute_row_delta_in_all_fram:10,test_compute_row_delta_in_all_frames_not_init_sort:10,test_compute_row_delta_single_samples_fram:10,test_dataset_id:10,test_edges_oper:9,test_equ:9,test_fast_init:[7,9],test_file_path:10,test_filter_cims_with_mask:9,test_find:10,test_generate_possible_sub_sets_of_s:7,test_get_node_id:9,test_get_node_indx:9,test_get_ordered_by_indx_set_of_par:9,test_get_parents_by_id:9,test_get_positional_node_indx:9,test_get_states_numb:9,test_hill_climbing_search:6,test_import_data:10,test_import_sampled_cim:10,test_import_structur:10,test_import_vari:10,test_init:[7,9,10],test_init_not_filled_dataframs:9,test_init_not_initialized_import:9,test_json_import:6,test_networkgraph:6,test_normalize_trajectori:10,test_normalize_trajectories_wrong_indx:10,test_normalize_trajectories_wrong_kei:10,test_ord:10,test_par:2,test_parameters_estim:6,test_put:10,test_read_json_file_found:10,test_read_json_file_not_found:10,test_repr:9,test_sample_import:6,test_sample_path:6,test_save_plot_estimated_graph:7,test_save_result:7,test_setofcim:6,test_structur:[6,8],test_structure_1:7,test_structure_2:7,test_structure_3:[7,8],test_structure_constraint_based_estim:6,test_structure_estim:6,test_structure_monoprocesso:7,test_structure_score_based_estim:6,test_tabu_search:6,test_tim:7,test_trajectori:6,testcach:10,testcas:[7,8,9,10],testconditionalintensitymatrix:9,testhillclimbingsearch:8,testjsonimport:10,testnetworkgraph:9,testparametersestimatior:7,testsampleimport:10,testsamplepath:9,testsetofcim:9,teststructur:9,teststructureconstraintbasedestim:7,teststructureestim:7,teststructurescorebasedestim:7,testtabusearch:8,testtrajectori:9,tha:5,theta:2,thi:[2,4,5,12],three:12,threshold:2,thumb:2,thumb_threshold:2,thumb_valu:2,time:[2,4,5,12],time_filt:4,time_kei:5,time_scalar_indexing_strucur:4,timestamp:5,to_nod:5,tot_vars_count:[2,3],total:[2,4],total_variables_count:4,total_variables_numb:4,traj:5,trajecory_head:5,trajectori:[0,1,2,5,12,13,14],trajectories_kei:5,trajectory_list:5,trajectri:12,transit:[2,4,5],transition_filt:4,transition_matric:4,transition_scalar_indexing_structur:4,tri:5,tupl:4,tutori:5,two:2,type:[2,3,4,5,12],union:5,uniqu:5,unittest:[7,8,9,10],unus:4,usag:[13,14],use:[2,12],used:[2,3,4,5],using:[2,3,4,5],util:[0,1,4,6,13,14],valid:2,valu:[2,3,4,5,9,12],values_list:12,var_id:2,variabl:[2,3,4,5,12],variable_cardin:5,variable_cim_xu_marginal_likelihood_q:2,variable_cim_xu_marginal_likelihood_theta:2,variable_label:5,variables_kei:5,variables_label:5,vector:[2,4],want:12,when:2,where:5,which:[2,3,4,5],whl:12,who:2,without:[2,3],you:[2,5,12],your:[13,14]},titles:["PyCTBN package","PyCTBN.PyCTBN package","PyCTBN.PyCTBN.estimators package","PyCTBN.PyCTBN.optimizers package","PyCTBN.PyCTBN.structure_graph package","PyCTBN.PyCTBN.utility package","PyCTBN.tests package","PyCTBN.tests.estimators package","PyCTBN.tests.optimizers package","PyCTBN.tests.structure_graph package","PyCTBN.tests.utility package","basic_main module","Examples","Welcome to PyCTBN\u2019s documentation!","PyCTBN","setup module"],titleterms:{"import":12,abstract_import:5,basic_main:11,cach:5,conditional_intensity_matrix:4,constraint_based_optim:3,content:[0,1,2,3,4,5,6,7,8,9,10],data:12,document:13,estim:[2,7,12],exampl:12,fam_score_calcul:2,hill_climbing_search:3,implement:12,indic:13,instal:12,json_import:5,modul:[0,1,2,3,4,5,6,7,8,9,10,11,15],network_graph:4,optim:[3,8],own:12,packag:[0,1,2,3,4,5,6,7,8,9,10],paramet:12,parameters_estim:2,pyctbn:[0,1,2,3,4,5,6,7,8,9,10,13,14],sample_import:5,sample_path:4,set_of_cim:4,setup:15,structur:[4,12],structure_constraint_based_estim:2,structure_estim:2,structure_graph:[4,9],structure_score_based_estim:2,submodul:[0,2,3,4,5,7,8,9,10],subpackag:[0,1,6],tabl:13,tabu_search:3,test:[6,7,8,9,10],test_cach:10,test_cim:9,test_hill_climbing_search:8,test_json_import:10,test_networkgraph:9,test_parameters_estim:7,test_sample_import:10,test_sample_path:9,test_setofcim:9,test_structur:9,test_structure_constraint_based_estim:7,test_structure_estim:7,test_structure_score_based_estim:7,test_tabu_search:8,test_trajectori:9,trajectori:4,usag:12,util:[5,10],welcom:13,your:12}}) \ No newline at end of file +Search.setIndex({docnames:["PyCTBN","PyCTBN.PyCTBN","PyCTBN.PyCTBN.estimators","PyCTBN.PyCTBN.optimizers","PyCTBN.PyCTBN.structure_graph","PyCTBN.PyCTBN.utility","PyCTBN.tests","PyCTBN.tests.estimators","PyCTBN.tests.optimizers","PyCTBN.tests.structure_graph","PyCTBN.tests.utility","basic_main","examples","index","modules","setup"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["PyCTBN.rst","PyCTBN.PyCTBN.rst","PyCTBN.PyCTBN.estimators.rst","PyCTBN.PyCTBN.optimizers.rst","PyCTBN.PyCTBN.structure_graph.rst","PyCTBN.PyCTBN.utility.rst","PyCTBN.tests.rst","PyCTBN.tests.estimators.rst","PyCTBN.tests.optimizers.rst","PyCTBN.tests.structure_graph.rst","PyCTBN.tests.utility.rst","basic_main.rst","examples.rst","index.rst","modules.rst","setup.rst"],objects:{"":{PyCTBN:[0,0,0,"-"]},"PyCTBN.PyCTBN":{estimators:[2,0,0,"-"],optimizers:[3,0,0,"-"],structure_graph:[4,0,0,"-"],utility:[5,0,0,"-"]},"PyCTBN.PyCTBN.estimators":{fam_score_calculator:[2,0,0,"-"],parameters_estimator:[2,0,0,"-"],structure_constraint_based_estimator:[2,0,0,"-"],structure_estimator:[2,0,0,"-"],structure_score_based_estimator:[2,0,0,"-"]},"PyCTBN.PyCTBN.estimators.fam_score_calculator":{FamScoreCalculator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.fam_score_calculator.FamScoreCalculator":{get_fam_score:[2,2,1,""],marginal_likelihood_q:[2,2,1,""],marginal_likelihood_theta:[2,2,1,""],single_cim_xu_marginal_likelihood_q:[2,2,1,""],single_cim_xu_marginal_likelihood_theta:[2,2,1,""],single_internal_cim_xxu_marginal_likelihood_theta:[2,2,1,""],variable_cim_xu_marginal_likelihood_q:[2,2,1,""],variable_cim_xu_marginal_likelihood_theta:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator":{ParametersEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[2,2,1,""],compute_state_res_time_for_node:[2,2,1,""],compute_state_transitions_for_a_node:[2,2,1,""],fast_init:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator":{StructureConstraintBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator":{complete_test:[2,2,1,""],compute_thumb_value:[2,2,1,""],ctpc_algorithm:[2,2,1,""],estimate_structure:[2,2,1,""],independence_test:[2,2,1,""],one_iteration_of_CTPC_algorithm:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator":{StructureEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator":{adjacency_matrix:[2,2,1,""],build_complete_graph:[2,2,1,""],build_removable_edges_matrix:[2,2,1,""],estimate_structure:[2,2,1,""],generate_possible_sub_sets_of_size:[2,2,1,""],save_plot_estimated_structure_graph:[2,2,1,""],save_results:[2,2,1,""],spurious_edges:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator":{StructureScoreBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator":{estimate_parents:[2,2,1,""],estimate_structure:[2,2,1,""],get_score_from_graph:[2,2,1,""]},"PyCTBN.PyCTBN.optimizers":{constraint_based_optimizer:[3,0,0,"-"],hill_climbing_search:[3,0,0,"-"],optimizer:[3,0,0,"-"],tabu_search:[3,0,0,"-"]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer":{ConstraintBasedOptimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search":{HillClimbing:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer":{Optimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer.Optimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search":{TabuSearch:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.structure_graph":{conditional_intensity_matrix:[4,0,0,"-"],network_graph:[4,0,0,"-"],sample_path:[4,0,0,"-"],set_of_cims:[4,0,0,"-"],structure:[4,0,0,"-"],trajectory:[4,0,0,"-"]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix":{ConditionalIntensityMatrix:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[4,2,1,""],compute_cim_coefficients:[4,2,1,""],state_residence_times:[4,2,1,""],state_transition_matrix:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph":{NetworkGraph:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph":{add_edges:[4,2,1,""],add_nodes:[4,2,1,""],build_p_comb_structure_for_a_node:[4,2,1,""],build_time_columns_filtering_for_a_node:[4,2,1,""],build_time_scalar_indexing_structure_for_a_node:[4,2,1,""],build_transition_filtering_for_a_node:[4,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[4,2,1,""],clear_indexing_filtering_structures:[4,2,1,""],edges:[4,2,1,""],fast_init:[4,2,1,""],get_node_indx:[4,2,1,""],get_ordered_by_indx_set_of_parents:[4,2,1,""],get_parents_by_id:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],has_edge:[4,2,1,""],nodes:[4,2,1,""],nodes_indexes:[4,2,1,""],nodes_values:[4,2,1,""],p_combs:[4,2,1,""],remove_edges:[4,2,1,""],remove_node:[4,2,1,""],time_filtering:[4,2,1,""],time_scalar_indexing_strucure:[4,2,1,""],transition_filtering:[4,2,1,""],transition_scalar_indexing_structure:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path":{SamplePath:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath":{build_structure:[4,2,1,""],build_trajectories:[4,2,1,""],clear_memory:[4,2,1,""],has_prior_net_structure:[4,2,1,""],structure:[4,2,1,""],total_variables_count:[4,2,1,""],trajectories:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims":{SetOfCims:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims":{actual_cims:[4,2,1,""],build_cims:[4,2,1,""],build_times_and_transitions_structures:[4,2,1,""],filter_cims_with_mask:[4,2,1,""],get_cims_number:[4,2,1,""],p_combs:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.structure":{Structure:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.structure.Structure":{add_edge:[4,2,1,""],clean_structure_edges:[4,2,1,""],contains_edge:[4,2,1,""],edges:[4,2,1,""],get_node_id:[4,2,1,""],get_node_indx:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],nodes_indexes:[4,2,1,""],nodes_labels:[4,2,1,""],nodes_values:[4,2,1,""],remove_edge:[4,2,1,""],remove_node:[4,2,1,""],total_variables_number:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory":{Trajectory:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory":{complete_trajectory:[4,2,1,""],size:[4,2,1,""],times:[4,2,1,""],trajectory:[4,2,1,""]},"PyCTBN.PyCTBN.utility":{abstract_importer:[5,0,0,"-"],cache:[5,0,0,"-"],json_importer:[5,0,0,"-"],sample_importer:[5,0,0,"-"]},"PyCTBN.PyCTBN.utility.abstract_importer":{AbstractImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter":{build_list_of_samples_array:[5,2,1,""],build_sorter:[5,2,1,""],clear_concatenated_frame:[5,2,1,""],compute_row_delta_in_all_samples_frames:[5,2,1,""],compute_row_delta_sigle_samples_frame:[5,2,1,""],concatenated_samples:[5,2,1,""],dataset_id:[5,2,1,""],file_path:[5,2,1,""],sorter:[5,2,1,""],structure:[5,2,1,""],variables:[5,2,1,""]},"PyCTBN.PyCTBN.utility.cache":{Cache:[5,1,1,""]},"PyCTBN.PyCTBN.utility.cache.Cache":{clear:[5,2,1,""],find:[5,2,1,""],put:[5,2,1,""]},"PyCTBN.PyCTBN.utility.json_importer":{JsonImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.json_importer.JsonImporter":{build_sorter:[5,2,1,""],clear_data_frame_list:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""],import_sampled_cims:[5,2,1,""],import_structure:[5,2,1,""],import_trajectories:[5,2,1,""],import_variables:[5,2,1,""],normalize_trajectories:[5,2,1,""],one_level_normalizing:[5,2,1,""],read_json_file:[5,2,1,""]},"PyCTBN.PyCTBN.utility.sample_importer":{SampleImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.sample_importer.SampleImporter":{build_sorter:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""]},"PyCTBN.tests":{estimators:[7,0,0,"-"],optimizers:[8,0,0,"-"],structure_graph:[9,0,0,"-"],utility:[10,0,0,"-"]},"PyCTBN.tests.estimators":{test_parameters_estimator:[7,0,0,"-"],test_structure_constraint_based_estimator:[7,0,0,"-"],test_structure_estimator:[7,0,0,"-"],test_structure_score_based_estimator:[7,0,0,"-"]},"PyCTBN.tests.estimators.test_parameters_estimator":{TestParametersEstimatior:[7,1,1,""]},"PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior":{aux_import_sampled_cims:[7,2,1,""],cim_equality_test:[7,2,1,""],equality_of_cims_of_node:[7,2,1,""],setUpClass:[7,2,1,""],test_compute_parameters_for_node:[7,2,1,""],test_fast_init:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_constraint_based_estimator":{TestStructureConstraintBasedEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_constraint_based_estimator.TestStructureConstraintBasedEstimator":{setUpClass:[7,2,1,""],test_structure_1:[7,2,1,""],test_structure_2:[7,2,1,""],test_structure_3:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_estimator":{TestStructureEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator":{setUpClass:[7,2,1,""],test_adjacency_matrix:[7,2,1,""],test_build_complete_graph:[7,2,1,""],test_build_removable_edges_matrix:[7,2,1,""],test_generate_possible_sub_sets_of_size:[7,2,1,""],test_init:[7,2,1,""],test_save_plot_estimated_graph:[7,2,1,""],test_save_results:[7,2,1,""],test_time:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_score_based_estimator":{TestStructureScoreBasedEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_score_based_estimator.TestStructureScoreBasedEstimator":{setUpClass:[7,2,1,""],test_structure_1:[7,2,1,""],test_structure_2:[7,2,1,""],test_structure_3:[7,2,1,""],test_structure_monoprocesso:[7,2,1,""]},"PyCTBN.tests.optimizers":{test_hill_climbing_search:[8,0,0,"-"],test_tabu_search:[8,0,0,"-"]},"PyCTBN.tests.optimizers.test_hill_climbing_search":{TestHillClimbingSearch:[8,1,1,""]},"PyCTBN.tests.optimizers.test_hill_climbing_search.TestHillClimbingSearch":{setUpClass:[8,2,1,""],test_structure:[8,2,1,""],test_structure_3:[8,2,1,""]},"PyCTBN.tests.optimizers.test_tabu_search":{TestTabuSearch:[8,1,1,""]},"PyCTBN.tests.optimizers.test_tabu_search.TestTabuSearch":{setUpClass:[8,2,1,""],test_structure:[8,2,1,""],test_structure_3:[8,2,1,""]},"PyCTBN.tests.structure_graph":{test_cim:[9,0,0,"-"],test_networkgraph:[9,0,0,"-"],test_sample_path:[9,0,0,"-"],test_setofcims:[9,0,0,"-"],test_structure:[9,0,0,"-"],test_trajectory:[9,0,0,"-"]},"PyCTBN.tests.structure_graph.test_cim":{TestConditionalIntensityMatrix:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_cim.TestConditionalIntensityMatrix":{setUpClass:[9,2,1,""],test_compute_cim_coefficients:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph":{TestNetworkGraph:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph.TestNetworkGraph":{aux_build_p_combs_structure:[9,2,1,""],aux_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],aux_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],aux_build_transition_columns_filtering_structure:[9,2,1,""],aux_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_add_edges:[9,2,1,""],test_add_nodes:[9,2,1,""],test_build_p_combs_structure:[9,2,1,""],test_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],test_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],test_build_transition_columns_filtering_structure:[9,2,1,""],test_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],test_fast_init:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_ordered_by_indx_set_of_parents:[9,2,1,""],test_get_parents_by_id:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_sample_path":{TestSamplePath:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_sample_path.TestSamplePath":{setUpClass:[9,2,1,""],test_buid_samplepath_no_concatenated_samples:[9,2,1,""],test_buid_samplepath_no_variables:[9,2,1,""],test_build_saplepath_no_prior_net_structure:[9,2,1,""],test_build_structure:[9,2,1,""],test_build_structure_bad_sorter:[9,2,1,""],test_build_trajectories:[9,2,1,""],test_init:[9,2,1,""],test_init_not_filled_dataframse:[9,2,1,""],test_init_not_initialized_importer:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_setofcims":{TestSetOfCims:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_setofcims.TestSetOfCims":{another_filtering_method:[9,2,1,""],aux_test_build_cims:[9,2,1,""],aux_test_init:[9,2,1,""],build_p_comb_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_build_cims:[9,2,1,""],test_filter_cims_with_mask:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_structure":{TestStructure:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_structure.TestStructure":{setUpClass:[9,2,1,""],test_edges_operations:[9,2,1,""],test_equality:[9,2,1,""],test_get_node_id:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_positional_node_indx:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_trajectory":{TestTrajectory:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_trajectory.TestTrajectory":{setUpClass:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.utility":{test_cache:[10,0,0,"-"],test_json_importer:[10,0,0,"-"],test_sample_importer:[10,0,0,"-"]},"PyCTBN.tests.utility.test_cache":{TestCache:[10,1,1,""]},"PyCTBN.tests.utility.test_cache.TestCache":{test_clear:[10,2,1,""],test_find:[10,2,1,""],test_init:[10,2,1,""],test_put:[10,2,1,""]},"PyCTBN.tests.utility.test_json_importer":{TestJsonImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_json_importer.TestJsonImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_build_sorter:[10,2,1,""],test_clear_concatenated_frame:[10,2,1,""],test_clear_data_frame_list:[10,2,1,""],test_compute_row_delta_in_all_frames:[10,2,1,""],test_compute_row_delta_in_all_frames_not_init_sorter:[10,2,1,""],test_compute_row_delta_single_samples_frame:[10,2,1,""],test_dataset_id:[10,2,1,""],test_file_path:[10,2,1,""],test_import_data:[10,2,1,""],test_import_sampled_cims:[10,2,1,""],test_import_structure:[10,2,1,""],test_import_variables:[10,2,1,""],test_init:[10,2,1,""],test_normalize_trajectories:[10,2,1,""],test_normalize_trajectories_wrong_indx:[10,2,1,""],test_normalize_trajectories_wrong_key:[10,2,1,""],test_read_json_file_found:[10,2,1,""],test_read_json_file_not_found:[10,2,1,""]},"PyCTBN.tests.utility.test_sample_importer":{TestSampleImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_sample_importer.TestSampleImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_init:[10,2,1,""],test_order:[10,2,1,""]},PyCTBN:{PyCTBN:[1,0,0,"-"],tests:[6,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"abstract":[2,3,4,5,12],"boolean":[2,4],"case":[7,8,9,10],"class":[2,3,4,5,7,8,9,10,12],"default":[2,3,5],"float":2,"function":2,"import":[4,5,13,14],"int":[2,3,4,5],"null":2,"return":[2,3,4,5,9,12],"static":[2,4],"super":12,"true":[2,12],"var":12,HAS:5,Has:[2,4],NOT:2,The:[2,4,5,12],Use:[2,12],__actual_cach:5,__init__:12,__list_of_sets_of_par:5,_actual_cim:4,_actual_trajectori:4,_aggregated_info_about_nodes_par:4,_array_indx:5,_cach:2,_cim:4,_complete_graph:2,_df_samples_list:[5,12],_df_structur:5,_df_variabl:[5,12],_file_path:12,_graph:[4,12],_import:4,_net_graph:2,_node:2,_node_id:4,_nodes_indx:2,_nodes_v:2,_p_combs_structur:4,_raw_data:5,_sample_path:2,_single_set_of_cim:2,_sorter:[5,12],_state_residence_tim:4,_structur:4,_structure_label:5,_time:4,_time_filt:4,_time_scalar_indexing_structur:4,_total_variables_count:4,_total_variables_numb:4,_trajectori:4,_transition_filt:4,_transition_matric:4,_transition_scalar_indexing_structur:4,_variables_label:5,abc:[3,5],about:[3,4],abstract_import:[0,1,4,13,14],abstractimport:[4,5,12],act:5,actual:[2,4],actual_cim:[4,12],add:[4,5],add_edg:4,add_nod:4,added:2,addit:2,adjac:[2,12],adjacency_matrix:[2,12],after:5,against:2,aggreg:4,algorithm:[2,3,12],all:[2,3,4,5,9,12],alpha_xu:2,alpha_xxu:2,alreadi:[5,12],also:[2,4],ani:[2,3],anoth:4,another_filtering_method:9,approach:2,arc:5,arrai:[2,4,5,12],assign:2,assum:2,automat:2,aux_build_p_combs_structur:9,aux_build_time_columns_filtering_structure_for_a_nod:9,aux_build_time_scalar_indexing_structure_for_a_nod:9,aux_build_transition_columns_filtering_structur:9,aux_build_transition_scalar_indexing_structure_for_a_nod:9,aux_import_sampled_cim:7,aux_test_build_cim:9,aux_test_init:9,axi:12,base:[2,3,4,5,7,8,9,10],bayesian:2,befor:[2,3,7,8,9,10],belong:2,best:2,between:5,bool:[2,4],both:[2,5],bound:4,build:[2,4,5,9,12],build_cim:4,build_complete_graph:2,build_list_of_samples_arrai:5,build_p_comb_structure_for_a_nod:[4,9],build_removable_edges_matrix:2,build_sort:[5,12],build_structur:[4,12],build_time_columns_filtering_for_a_nod:4,build_time_scalar_indexing_structure_for_a_nod:4,build_times_and_transitions_structur:4,build_trajectori:[4,12],build_transition_filtering_for_a_nod:4,build_transition_scalar_indexing_structure_for_a_nod:4,built:2,cach:[0,1,2,13,14],calcul:2,call:[5,12],cardin:[2,4,5,9],cardinalit:[4,5],caridin:4,caridinalit:4,chang:[4,5],check:4,chi:2,chi_test:2,chi_test_alfa:2,child:[2,3],child_indx:2,child_states_numb:2,child_val:2,cim1:[2,7],cim2:[2,7],cim:[2,4,5,12],cim_equality_test:7,cims_kei:5,cims_label:7,classmethod:[7,8,9,10],clean_structure_edg:4,clear:[4,5],clear_concatenated_fram:5,clear_data_frame_list:5,clear_indexing_filtering_structur:4,clear_memori:4,climb:[2,3],coeffici:4,col:4,cols_filt:2,column:[2,4,5,12],columns_head:5,comb:4,combin:[4,5,9],combinatori:[4,9],common:2,complet:[2,4,5],complete_test:2,complete_trajectori:4,comput:[2,3,4,5,12],compute_cim_coeffici:4,compute_parameters_for_nod:[2,12],compute_row_delta_in_all_samples_fram:[5,12],compute_row_delta_sigle_samples_fram:5,compute_state_res_time_for_nod:2,compute_state_transitions_for_a_nod:2,compute_thumb_valu:2,concatanated_sampl:5,concaten:[4,5],concatenated_sampl:5,condit:4,conditional_intensity_matrix:[0,1,2,13,14],conditionalintensitymatrix:[2,4],consid:[2,4],constraint:2,constraint_based_optim:[0,1,13,14],constraintbasedoptim:3,construct:[4,5,12],conta:5,contain:[2,4,5,9],contains_edg:4,content:[13,14],convert:[2,5],copi:5,core:5,correct:[4,5],could:2,count:4,creat:[2,4,12],csv:12,csvimport:12,ctbn:2,ctpc:[2,3,12],ctpc_algorithm:[2,12],current:[2,3,5],cut:5,dafram:5,data:[2,3,4,5,13,14],datafram:[4,5,12],dataset:[3,4,5],dataset_id:[5,12],datfram:5,def:12,defin:5,definit:5,defualt:2,delta:[2,4,5],demonstr:12,describ:5,desir:[2,4],df_samples_list:5,dict:[5,12],dictionari:5,differ:5,differt:2,digraph:2,dimens:4,dir:12,direct:[2,4],directli:5,disabl:[2,3],disable_multiprocess:2,distribuit:2,doc:5,doubl:4,download:12,drop:12,duplic:4,dyn:12,each:[2,3,5],edg:[2,4,5,12],edges_list:4,end:5,entir:2,equal:4,equality_of_cims_of_nod:7,est:12,estim:[0,1,3,4,6,13,14],estimate_par:2,estimate_structur:2,estimated_cim:7,everi:[4,5],exam:12,exampl:[5,13,14],exclud:2,exctract:5,exist:5,exp_test_alfa:2,exponenti:2,expos:5,extend:12,extens:[2,5],extract:[4,5],fals:2,fam_score_calcul:[0,1,13,14],famscor:2,famscorecalcul:2,fast_init:[2,4,12],file:[2,5,12],file_path:[2,5,12],filepath:5,fill:[2,12],filter:[2,4],filter_cims_with_mask:4,find:[2,5],first:[2,12],fixtur:[7,8,9,10],follow:[4,5],form:4,format:12,formula:2,found:5,frame:5,from:[4,5,12],from_nod:5,gener:2,generate_possible_sub_sets_of_s:2,get:[2,5],get_cims_numb:4,get_fam_scor:2,get_node_id:4,get_node_indx:4,get_ordered_by_indx_set_of_par:4,get_parents_by_id:4,get_positional_node_indx:4,get_score_from_graph:2,get_states_numb:4,given:[2,4,5],glob:12,graph:[2,4,9,12],graph_struct:4,graphic:2,grid:[4,9],grpah:12,has:[5,12],has_edg:4,has_prior_net_structur:4,have:5,header:5,header_column:5,hill:[2,3],hill_climbing_search:[0,1,13,14],hillclimb:3,hold:[2,4],hook:[7,8,9,10],how:5,hyperparamet:2,hypothesi:2,identifi:[2,4,5],iff:2,implement:[3,5,13,14],import_data:[5,12],import_sampled_cim:5,import_structur:5,import_trajectori:5,import_vari:[5,12],improv:[2,3],includ:2,independ:2,independence_test:2,index:[2,4,5,12,13],indic:[2,4],indx:5,info:[4,12],inform:[3,4],init:12,initi:[2,4,5,12],inplac:12,insid:12,instal:[13,14],interest:4,interfac:3,intes:4,iter:[2,3],iterations_numb:[2,3],its:[2,3],join:12,json:[2,5,12],json_import:[0,1,13,14],jsonarrai:5,jsonimport:[5,12],keep:[2,3,5],kei:5,kind:2,knowledg:2,known:2,known_edg:2,label:[2,3,4,5],latest:12,lenght:[2,3],level:[2,5],likelihood:2,list:[2,3,4,5,12],list_of_column:4,list_of_edg:4,list_of_nod:4,load:5,loop:2,m_xu_suff_stat:2,m_xxu_suff_stat:2,main:12,margin:2,marginal_likelihood_q:2,marginal_likelihood_theta:2,mask:[4,9],mask_arr:4,matric:[2,4],matrix:[2,4,5,9,12],max_par:[2,3],maximum:[2,3],member:[4,5],mention:4,merg:5,method:[2,5,7,8,9,10],methodnam:[7,8,9,10],model:2,modul:[13,14],multipl:5,multiprocess:2,name:[2,4,5,12],ndarrai:[2,4,5],necessari:[2,4,5],nest:5,net:[2,3,4,5,12],net_graph:2,network:[2,4,5],network_graph:[0,1,2,13,14],networkgraph:[2,4,12],networkx:2,node:[2,3,4,5,9,12],node_id:[2,3,4,9],node_index:4,node_indx:[2,4],node_st:[4,9],node_states_numb:[4,9],nodes_index:4,nodes_indexes_arr:4,nodes_label:4,nodes_labels_list:4,nodes_numb:4,nodes_vals_arr:4,nodes_valu:[4,12],none:[2,3,4,5,7,9,10,12],normal:5,normalize_trajectori:5,number:[2,3,4],numpi:[2,4,5,9],obj:[10,12],object:[2,3,4,5,12],one:[4,5],one_iteration_of_ctpc_algorithm:2,one_level_norm:5,onli:5,oper:2,optim:[0,1,2,6,13,14],optimize_structur:3,option:[2,3],order:[2,5,10],origin:5,original_cols_numb:4,otherwis:[2,5],out:5,outer:[5,12],over:2,own:[13,14],p_comb:[4,9],p_indx:[4,9],p_val:9,p_valu:9,packag:[13,14],page:13,panda:[5,12],param:4,paramet:[2,3,4,5,9,13,14],parameters_estim:[0,1,13,14],parametersestim:[2,12],parent:[2,3,4,5],parent_indx:2,parent_label:2,parent_set:2,parent_set_v:2,parent_v:2,parent_valu:9,parents_cardin:4,parents_comb:5,parents_index:4,parents_indx:9,parents_label:[4,9],parents_states_numb:[4,9],parents_v:[4,9],parents_valu:[4,9],part:2,particular:[2,5],pass:12,path:[2,5,12],patienc:[2,3],peest:12,perform:2,pip:12,place:5,plot:2,png:2,posit:[4,5],possibl:[2,4],predict:3,prepar:5,present:[2,5],print:12,prior:[2,12],prior_net_structur:5,process:[2,3,4,5],processes_numb:2,properli:5,properti:[4,5],put:5,pyctbn:12,q_xx:4,rappres:4,raw:5,raw_data:5,read:[5,12],read_csv:12,read_csv_fil:12,read_fil:12,read_json_fil:5,real:[2,4,5,12],refer:[4,5],reject:2,rel:4,relat:5,releas:12,remain:5,remov:[2,4,5],remove_edg:4,remove_nod:4,repres:4,represent:2,res:4,resid:[2,4],result:[2,5,12],rtype:4,rule:[2,3],run:[7,8,9,10],runtest:[7,8,9,10],same:5,sampl:[4,5,12],sample_fram:[5,12],sample_import:[0,1,13,14],sample_path:[0,1,2,13,14],sampled_cim:7,sampleimport:5,samplepath:[2,4,12],samples_label:5,save:[2,12],save_plot_estimated_structure_graph:2,save_result:[2,12],scalar_index:2,scalar_indexes_struct:2,score:2,se1:12,search:[2,3,13],second:2,see:5,select:12,self:[2,5,12],sep:2,sep_set:2,set:[2,4,5,7,8,9,10],set_of_cim:[0,1,2,5,13,14],setofcim:[2,4,5,12],setupclass:[7,8,9,10],shift:[4,5],shifted_cols_head:5,show:2,signific:2,simbol:5,simpl:12,simpli:12,sinc:4,single_cim_xu_marginal_likelihood_q:2,single_cim_xu_marginal_likelihood_theta:2,single_internal_cim_xxu_marginal_likelihood_theta:2,size:[2,4],socim:5,sofc1:12,sorter:5,specif:[2,4,12],spuriou:2,spurious_edg:2,start:5,state:[2,4],state_res_tim:4,state_residence_tim:4,state_transition_matrix:4,statist:2,stop:[2,3],str:[2,3,4,5,12],string:[2,3,4,5],structur:[0,1,2,3,5,9,13,14],structure_constraint_based_estim:[0,1,13,14],structure_estim:[0,1,3,13,14],structure_estimation_exampl:12,structure_graph:[0,1,2,5,6,13,14],structure_label:5,structure_score_based_estim:[0,1,13,14],structureconstraintbasedestim:2,structureestim:[2,3,12],structurescorebasedestim:2,structut:4,style:2,submodul:[1,6,13,14],subpackag:[13,14],subset:2,suffici:2,suffuci:2,symbol:[4,5],synthet:5,t_xu_suff_stat:2,tabu:[2,3],tabu_length:[2,3],tabu_rules_dur:[2,3],tabu_search:[0,1,13,14],tabusearch:3,take:12,tar:12,task:[2,4],tau_xu:2,ternari:12,test:2,test_add_edg:9,test_add_nod:9,test_adjacency_matrix:7,test_buid_samplepath_no_concatenated_sampl:9,test_buid_samplepath_no_vari:9,test_build_cim:9,test_build_complete_graph:7,test_build_p_combs_structur:9,test_build_removable_edges_matrix:7,test_build_saplepath_no_prior_net_structur:9,test_build_sort:10,test_build_structur:9,test_build_structure_bad_sort:9,test_build_time_columns_filtering_structure_for_a_nod:9,test_build_time_scalar_indexing_structure_for_a_nod:9,test_build_trajectori:9,test_build_transition_columns_filtering_structur:9,test_build_transition_scalar_indexing_structure_for_a_nod:9,test_cach:6,test_child:2,test_cim:6,test_clear:10,test_clear_concatenated_fram:10,test_clear_data_frame_list:10,test_compute_cim_coeffici:9,test_compute_parameters_for_nod:7,test_compute_row_delta_in_all_fram:10,test_compute_row_delta_in_all_frames_not_init_sort:10,test_compute_row_delta_single_samples_fram:10,test_dataset_id:10,test_edges_oper:9,test_equ:9,test_fast_init:[7,9],test_file_path:10,test_filter_cims_with_mask:9,test_find:10,test_generate_possible_sub_sets_of_s:7,test_get_node_id:9,test_get_node_indx:9,test_get_ordered_by_indx_set_of_par:9,test_get_parents_by_id:9,test_get_positional_node_indx:9,test_get_states_numb:9,test_hill_climbing_search:6,test_import_data:10,test_import_sampled_cim:10,test_import_structur:10,test_import_vari:10,test_init:[7,9,10],test_init_not_filled_dataframs:9,test_init_not_initialized_import:9,test_json_import:6,test_networkgraph:6,test_normalize_trajectori:10,test_normalize_trajectories_wrong_indx:10,test_normalize_trajectories_wrong_kei:10,test_ord:10,test_par:2,test_parameters_estim:6,test_put:10,test_read_json_file_found:10,test_read_json_file_not_found:10,test_repr:9,test_sample_import:6,test_sample_path:6,test_save_plot_estimated_graph:7,test_save_result:7,test_setofcim:6,test_structur:[6,8],test_structure_1:7,test_structure_2:7,test_structure_3:[7,8],test_structure_constraint_based_estim:6,test_structure_estim:6,test_structure_monoprocesso:7,test_structure_score_based_estim:6,test_tabu_search:6,test_tim:7,test_trajectori:6,testcach:10,testcas:[7,8,9,10],testconditionalintensitymatrix:9,testhillclimbingsearch:8,testjsonimport:10,testnetworkgraph:9,testparametersestimatior:7,testsampleimport:10,testsamplepath:9,testsetofcim:9,teststructur:9,teststructureconstraintbasedestim:7,teststructureestim:7,teststructurescorebasedestim:7,testtabusearch:8,testtrajectori:9,tha:5,theta:2,thi:[2,4,5,12],three:12,threshold:2,thumb:2,thumb_threshold:2,thumb_valu:2,time:[2,4,5,12],time_filt:4,time_kei:5,time_scalar_indexing_strucur:4,timestamp:5,to_nod:5,tot_vars_count:[2,3],total:[2,4],total_variables_count:4,total_variables_numb:4,traj:5,trajecory_head:5,trajectori:[0,1,2,5,12,13,14],trajectories_kei:5,trajectory_list:5,trajectri:12,transit:[2,4,5],transition_filt:4,transition_matric:4,transition_scalar_indexing_structur:4,tri:5,tupl:4,tutori:5,two:2,type:[2,3,4,5,12],union:5,uniqu:5,unittest:[7,8,9,10],unus:4,usag:[13,14],use:[2,12],used:[2,3,4,5],using:[2,3,4,5],util:[0,1,4,6,13,14],valid:2,valu:[2,3,4,5,9,12],values_list:12,var_id:2,variabl:[2,3,4,5,12],variable_cardin:5,variable_cim_xu_marginal_likelihood_q:2,variable_cim_xu_marginal_likelihood_theta:2,variable_label:5,variables_kei:5,variables_label:5,vector:[2,4],want:12,when:2,where:5,which:[2,3,4,5],whl:12,who:2,without:[2,3],you:[2,5,12],your:[13,14]},titles:["PyCTBN package","PyCTBN.PyCTBN package","PyCTBN.PyCTBN.estimators package","PyCTBN.PyCTBN.optimizers package","PyCTBN.PyCTBN.structure_graph package","PyCTBN.PyCTBN.utility package","PyCTBN.tests package","PyCTBN.tests.estimators package","PyCTBN.tests.optimizers package","PyCTBN.tests.structure_graph package","PyCTBN.tests.utility package","basic_main module","Examples","Welcome to PyCTBN\u2019s documentation!","PyCTBN","setup module"],titleterms:{"import":12,abstract_import:5,basic_main:11,cach:5,conditional_intensity_matrix:4,constraint_based_optim:3,content:[0,1,2,3,4,5,6,7,8,9,10],data:12,document:13,estim:[2,7,12],exampl:12,fam_score_calcul:2,hill_climbing_search:3,implement:12,indic:13,instal:12,json_import:5,modul:[0,1,2,3,4,5,6,7,8,9,10,11,15],network_graph:4,optim:[3,8],own:12,packag:[0,1,2,3,4,5,6,7,8,9,10],paramet:12,parameters_estim:2,pyctbn:[0,1,2,3,4,5,6,7,8,9,10,13,14],sample_import:5,sample_path:4,set_of_cim:4,setup:15,structur:[4,12],structure_constraint_based_estim:2,structure_estim:2,structure_graph:[4,9],structure_score_based_estim:2,submodul:[0,2,3,4,5,7,8,9,10],subpackag:[0,1,6],tabl:13,tabu_search:3,test:[6,7,8,9,10],test_cach:10,test_cim:9,test_hill_climbing_search:8,test_json_import:10,test_networkgraph:9,test_parameters_estim:7,test_sample_import:10,test_sample_path:9,test_setofcim:9,test_structur:9,test_structure_constraint_based_estim:7,test_structure_estim:7,test_structure_score_based_estim:7,test_tabu_search:8,test_trajectori:9,trajectori:4,usag:12,util:[5,10],welcom:13,your:12}}) \ No newline at end of file diff --git a/docs-out/_build/html/setup.html b/docs-out/_build/html/setup.html index d942353..8f74cf7 100644 --- a/docs-out/_build/html/setup.html +++ b/docs-out/_build/html/setup.html @@ -58,7 +58,7 @@ -

                                                                        Contents:

                                                                        +

                                                                        Contents:

                                                                        • PyCTBN.PyCTBN package
                                                                          • Subpackages
                                                                          • @@ -112,9 +112,9 @@
                                                                            -
                                                                            +

                                                                            setup module

                                                                            -
                                                                            +
                                                                            diff --git a/docs-out/esempio_dataset.png b/docs-out/esempio_dataset.png new file mode 100644 index 0000000..fd4d336 Binary files /dev/null and b/docs-out/esempio_dataset.png differ diff --git a/docs-out/examples.rst b/docs-out/examples.rst index b1e07c5..5386451 100644 --- a/docs-out/examples.rst +++ b/docs-out/examples.rst @@ -3,9 +3,9 @@ Examples Installation/Usage ****************** -Download the release in .tar.gz or .whl format and simply use pip install to install it:: +Download the latest release in .tar.gz or .whl format and simply use pip install to install it:: - $pip install PyCTBN-1.0.tar.gz + $pip install PyCTBN-2.2.tar.gz Implementing your own data importer diff --git a/docs/PyCTBN.PyCTBN.estimators.html b/docs/PyCTBN.PyCTBN.estimators.html index b8278b8..1644fa4 100644 --- a/docs/PyCTBN.PyCTBN.estimators.html +++ b/docs/PyCTBN.PyCTBN.estimators.html @@ -65,7 +65,7 @@ -

                                                                            Contents:

                                                                            +

                                                                            Contents:

                                                                            • PyCTBN.PyCTBN package
                                                                              • Subpackages
                                                                              • @@ -119,12 +119,12 @@
                                                                                -
                                                                                +

                                                                                PyCTBN.PyCTBN.estimators package

                                                                                -
                                                                                +

                                                                                Submodules

                                                                                -
                                                                                -
                                                                                +
                                                                                +

                                                                                PyCTBN.PyCTBN.estimators.fam_score_calculator module

                                                                                @@ -304,8 +304,8 @@ and a specif parents’s assignment

                                                                                -
                                                                                -
                                                                                + +

                                                                                PyCTBN.PyCTBN.estimators.parameters_estimator module

                                                                                @@ -389,8 +389,8 @@ in the graph _net_g
                                                                                -
                                                                                -
                                                                                + +

                                                                                PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator module

                                                                                @@ -470,23 +470,39 @@ Generates all the necessary structures and datas to perform the tests.

                                                                                -
                                                                                -ctpc_algorithm(disable_multiprocessing: bool = False)
                                                                                + +
                                                                                +ctpc_algorithm(disable_multiprocessing: bool = False, processes_number: int = None)
                                                                                +

                                                                                Compute the CTPC algorithm over the entire net.

                                                                                +
                                                                                +
                                                                                Parameters
                                                                                +
                                                                                  +
                                                                                • disable_multiprocessing (Boolean, optional) – true if you desire to disable the multiprocessing operations, default to False

                                                                                • +
                                                                                • processes_number – if disable_multiprocessing is false indicates

                                                                                • +
                                                                                +
                                                                                +
                                                                                +

                                                                                the maximum number of process; if None it will be automatically set, default to None +:type processes_number: int, optional

                                                                                -
                                                                                -estimate_structure(disable_multiprocessing: bool = False)
                                                                                -

                                                                                Abstract method to estimate the structure

                                                                                + +
                                                                                +estimate_structure(disable_multiprocessing: bool = False, processes_number: int = None)
                                                                                +

                                                                                Compute the constraint-based algorithm to find the optimal structure

                                                                                +
                                                                                -
                                                                                Returns
                                                                                -

                                                                                List of estimated edges

                                                                                -
                                                                                -
                                                                                Return type
                                                                                -

                                                                                Typing.List

                                                                                +
                                                                                Parameters
                                                                                +
                                                                                  +
                                                                                • disable_multiprocessing (Boolean, optional) – true if you desire to disable the multiprocessing operations, default to False

                                                                                • +
                                                                                • processes_number – if disable_multiprocessing is false indicates

                                                                                • +
                                                                                +

                                                                                the maximum number of process; if None it will be automatically set, default to None +:type processes_number: int, optional

                                                                                @@ -525,8 +541,8 @@ it is performed also the chi_test.

                                                                                -
                                                                                -
                                                                                + +

                                                                                PyCTBN.PyCTBN.estimators.structure_estimator module

                                                                                @@ -638,10 +654,11 @@ that do not contains a the node identified by -
                                                                                -save_plot_estimated_structure_graph(file_path: str)None
                                                                                -

                                                                                Plot the estimated structure in a graphical model style, use .png extension. -Spurious edges are colored in red if a prior structure is present.

                                                                                + +
                                                                                +save_plot_estimated_structure_graph(file_path: str) → None
                                                                                +

                                                                                Plot the estimated structure in a graphical model style, use .png extension.

                                                                                +
                                                                                Parameters

                                                                                file_path – path to save the file to

                                                                                @@ -682,8 +699,8 @@ Spurious edges are colored in red if a prior structure is present.

                                                                                -
                                                                                -
                                                                                + +

                                                                                PyCTBN.PyCTBN.estimators.structure_score_based_estimator module

                                                                                @@ -727,8 +744,10 @@ using a score based approach and differt kinds of optimization algorithms.

                                                                                -
                                                                                -estimate_structure(max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None, tabu_length: Optional[int] = None, tabu_rules_duration: Optional[int] = None, optimizer: str = 'tabu', disable_multiprocessing: bool = False)
                                                                                + +
                                                                                +estimate_structure(max_parents: int = None, iterations_number: int = 40, patience: int = None, tabu_length: int = None, tabu_rules_duration: int = None, optimizer: str = 'tabu', disable_multiprocessing: bool = False, processes_number: int = None)
                                                                                +

                                                                                Compute the score-based algorithm to find the optimal structure

                                                                                Parameters
                                                                                @@ -740,9 +759,12 @@ using a score based approach and differt kinds of optimization algorithms.

                                                                              • tabu_rules_duration (int, optional) – number of iterations in which each rule keeps its value, default to None

                                                                              • optimizer (string, optional) – name of the optimizer algorithm. Possible values: ‘hill’ (Hill climbing),’tabu’ (tabu search), defualt to ‘tabu’

                                                                              • disable_multiprocessing (Boolean, optional) – true if you desire to disable the multiprocessing operations, default to False

                                                                              • +
                                                                              • processes_number – if disable_multiprocessing is false indicates

                                                                              +

                                                                              the maximum number of process; if None it will be automatically set, default to None +:type processes_number: int, optional

                                                                              @@ -767,11 +789,11 @@ using a score based approach and differt kinds of optimization algorithms.

                                                                              -
                                                                            -
                                                                            + +

                                                                            Module contents

                                                                            -
                                                                            -
                                                                + +
                                                            diff --git a/docs/PyCTBN.PyCTBN.html b/docs/PyCTBN.PyCTBN.html index 612f45b..17c42b8 100644 --- a/docs/PyCTBN.PyCTBN.html +++ b/docs/PyCTBN.PyCTBN.html @@ -64,7 +64,7 @@ -

                                                            Contents:

                                                            +

                                                            Contents:

                                                            • PyCTBN.PyCTBN package
                                                              • Subpackages
                                                              • @@ -118,9 +118,9 @@
                                                                -
                                                                +

                                                                PyCTBN.PyCTBN package

                                                                -
                                                                +

                                                                Subpackages

                                                                  @@ -169,11 +169,11 @@
                                                                -
                                                                -
                                                                +
                                                                +

                                                                Module contents

                                                                -
                                                                -
                                                                + +
                                                                diff --git a/docs/PyCTBN.PyCTBN.optimizers.html b/docs/PyCTBN.PyCTBN.optimizers.html index 490dcab..94e6d69 100644 --- a/docs/PyCTBN.PyCTBN.optimizers.html +++ b/docs/PyCTBN.PyCTBN.optimizers.html @@ -65,7 +65,7 @@ -

                                                                Contents:

                                                                +

                                                                Contents:

                                                                • PyCTBN.PyCTBN package
                                                                  • Subpackages
                                                                  • @@ -119,12 +119,12 @@
                                                                    -
                                                                    +

                                                                    PyCTBN.PyCTBN.optimizers package

                                                                    -
                                                                    +

                                                                    Submodules

                                                                    -
                                                                    -
                                                                    +
                                                                    +

                                                                    PyCTBN.PyCTBN.optimizers.constraint_based_optimizer module

                                                                    @@ -156,8 +156,8 @@
                                                                    -
                                                                    - -
                                                                    + +

                                                                    PyCTBN.PyCTBN.optimizers.optimizer module

                                                                    @@ -223,8 +223,8 @@
                                                                    -
                                                                    - -
                                                                    + +

                                                                    Module contents

                                                                    -
                                                                    -
                                                                    + +
                                                                    diff --git a/docs/PyCTBN.PyCTBN.structure_graph.html b/docs/PyCTBN.PyCTBN.structure_graph.html index 05ac780..6f9561a 100644 --- a/docs/PyCTBN.PyCTBN.structure_graph.html +++ b/docs/PyCTBN.PyCTBN.structure_graph.html @@ -65,7 +65,7 @@ -

                                                                    Contents:

                                                                    +

                                                                    Contents:

                                                                    • PyCTBN.PyCTBN package
                                                                      • Subpackages
                                                                      • @@ -119,12 +119,12 @@
                                                                        -
                                                                        +

                                                                        PyCTBN.PyCTBN.structure_graph package

                                                                        -
                                                                        +

                                                                        Submodules

                                                                        -
                                                                        -
                                                                        +
                                                                        +

                                                                        PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module

                                                                        @@ -244,8 +244,8 @@ This method must obviously be executed after the graph has been generated.

                                                                        -
                                                                        -
                                                                        + +

                                                                        PyCTBN.PyCTBN.structure_graph.network_graph module

                                                                        @@ -537,8 +537,8 @@ Initialize all the filtering/indexing structures.

                                                                        -
                                                                        -
                                                                        + +

                                                                        PyCTBN.PyCTBN.structure_graph.sample_path module

                                                                        @@ -601,8 +601,8 @@ Clears all the unused dataframes in <
                                                                        -
                                                                        -
                                                                        + +

                                                                        PyCTBN.PyCTBN.structure_graph.set_of_cims module

                                                                        @@ -687,8 +687,8 @@ Compute the cim coefficients.The class member +
                                                                        +

                                                                        PyCTBN.PyCTBN.structure_graph.structure module

                                                                        @@ -816,8 +816,8 @@ The class member _t
                                                                        -
                                                                        -
                                                                        + +

                                                                        PyCTBN.PyCTBN.structure_graph.trajectory module

                                                                        @@ -861,82 +861,13 @@ The class member _t
                                                                        -
                                                                        -
                                                                        -

                                                                        PyCTBN.PyCTBN.structure_graph.trajectory_generator module

                                                                        -
                                                                        -
                                                                        -class PyCTBN.PyCTBN.structure_graph.trajectory_generator.TrajectoryGenerator(importer: Optional[PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter] = None, variables: Optional[pandas.core.frame.DataFrame] = None, dyn_str: Optional[pandas.core.frame.DataFrame] = None, dyn_cims: Optional[dict] = None)
                                                                        -

                                                                        Bases: object

                                                                        -

                                                                        Provides the methods to generate a trajectory basing on the network defined -in the importer.

                                                                        -
                                                                        -
                                                                        Parameters
                                                                        -
                                                                          -
                                                                        • _importer (AbstractImporter) – the Importer object which contains the imported and processed data

                                                                        • -
                                                                        • _vnames (List) – List of the variables labels that belong to the network

                                                                        • -
                                                                        • _parents (Dict) – It contains, for each variable label (the key), the list of related parents labels

                                                                        • -
                                                                        • _cims (Dict) – It contains, for each variable label (the key), the SetOfCims object related to it

                                                                        • -
                                                                        • _generated_trajectory (pandas.DataFrame) – Result of the execution of CTBN_Sample, contains the output trajectory

                                                                        • -
                                                                        -
                                                                        -
                                                                        -
                                                                        -
                                                                        -CTBN_Sample(t_end=- 1, max_tr=- 1)
                                                                        -
                                                                        -
                                                                        This method implements the generation of a trajectory, basing on the network structure and

                                                                        on the coefficients defined in the CIMs. -The variables are initialized with value 0, and the method takes care of adding the -conventional last row made up of -1.

                                                                        -
                                                                        -
                                                                        -
                                                                        -
                                                                        Parameters
                                                                        -
                                                                          -
                                                                        • t_end (float) – If defined, the sampling ends when end time is reached

                                                                        • -
                                                                        • max_tr (int) – Parameter taken in consideration in case that t_end isn’t defined. It specifies the number of transitions to execute

                                                                        • -
                                                                        -
                                                                        -
                                                                        -
                                                                        - -
                                                                        -
                                                                        -multi_trajectory(t_ends: Optional[list] = None, max_trs: Optional[list] = None)
                                                                        -

                                                                        Generate n trajectories in parallel, where n is the number of items in -t_ends, if defined, or the number of items in max_trs otherwise

                                                                        -
                                                                        -
                                                                        Parameters
                                                                        -
                                                                          -
                                                                        • t_ends (list) – List of t_end values for the trajectories that will be generated

                                                                        • -
                                                                        • max_trs (list) – List of max_tr values for the trajectories that will be generated

                                                                        • -
                                                                        -
                                                                        -
                                                                        -
                                                                        - -
                                                                        -
                                                                        -worker(t_end, max_tr, trajectories)
                                                                        -

                                                                        Single process that will be executed in parallel in order to generate one trajectory.

                                                                        -
                                                                        -
                                                                        Parameters
                                                                        -
                                                                          -
                                                                        • t_end (float) – If defined, the sampling ends when end time is reached

                                                                        • -
                                                                        • max_tr (int) – Parameter taken in consideration in case that t_end isn’t defined. It specifies the number of transitions to execute

                                                                        • -
                                                                        • trajectories (list) – Shared list that contains to which the generated trajectory is added

                                                                        • -
                                                                        -
                                                                        -
                                                                        -
                                                                        -
                                                                        + +
                                                                        -
                                                                        -

                                                                        Module contents

                                                                        -
                                                                        -
                                                                        + +
                                                                        diff --git a/docs/PyCTBN.PyCTBN.utility.html b/docs/PyCTBN.PyCTBN.utility.html index 70f31f9..05eaa8e 100644 --- a/docs/PyCTBN.PyCTBN.utility.html +++ b/docs/PyCTBN.PyCTBN.utility.html @@ -65,7 +65,7 @@ -

                                                                        Contents:

                                                                        +

                                                                        Contents:

                                                                        • PyCTBN.PyCTBN package
                                                                          • Subpackages
                                                                          • @@ -119,58 +119,14 @@
                                                                            -
                                                                            +

                                                                            PyCTBN.PyCTBN.utility package

                                                                            -
                                                                            +

                                                                            Submodules

                                                                            -
                                                                            -
                                                                            -

                                                                            PyCTBN.PyCTBN.utility.abstract_exporter module

                                                                            -
                                                                            -
                                                                            -class PyCTBN.PyCTBN.utility.abstract_exporter.AbstractExporter(variables: Optional[pandas.core.frame.DataFrame] = None, dyn_str: Optional[pandas.core.frame.DataFrame] = None, dyn_cims: Optional[dict] = None)
                                                                            -

                                                                            Bases: abc.ABC

                                                                            -

                                                                            Abstract class that exposes the methods to save in json format a network information -along with one or more trajectories generated basing on it

                                                                            -
                                                                            -
                                                                            Parameters
                                                                            -
                                                                              -
                                                                            • _variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities

                                                                            • -
                                                                            • _dyn_str (pandas.DataFrame) – Dataframe containing the structure of the network (edges)

                                                                            • -
                                                                            • _dyn_cims (dict) – It contains, for every variable (label is the key), the SetOfCims object related to it

                                                                            • -
                                                                            • _trajectories (List) – List of trajectories, that can be added subsequently

                                                                            • -
                                                                            -
                                                                            -
                                                                            -
                                                                            -
                                                                            -add_trajectory(trajectory: list)
                                                                            -

                                                                            Add a new trajectory to the current list

                                                                            -
                                                                            -
                                                                            Parameters
                                                                            -

                                                                            trajectory (pandas.DataFrame) – The trajectory to add

                                                                            -
                                                                            -
                                                                            -
                                                                            -
                                                                            -
                                                                            -abstract out_file(filename)
                                                                            -
                                                                            -
                                                                            Create a file in current directory and write on it the previously added data

                                                                            (variables, dyn_str, dyn_cims and trajectories)

                                                                            -
                                                                            -
                                                                            -
                                                                            -
                                                                            Parameters
                                                                            -

                                                                            filename (string) – Name of the output file (it must include json extension)

                                                                            -
                                                                            -
                                                                            -
                                                                            - -
                                                                            +
                                                                            +
                                                                            -
                                                                            -

                                                                            PyCTBN.PyCTBN.utility.abstract_importer module

                                                                            @@ -331,8 +287,8 @@ dataset

                                                                            -
                                                                            -
                                                                            + +

                                                                            PyCTBN.PyCTBN.utility.cache module

                                                                            @@ -390,48 +346,10 @@ None otherwise.

                                                                            -
                                                                            -
                                                                            -

                                                                            PyCTBN.PyCTBN.utility.json_exporter module

                                                                            -
                                                                            -
                                                                            -class PyCTBN.PyCTBN.utility.json_exporter.JsonExporter(variables: Optional[pandas.core.frame.DataFrame] = None, dyn_str: Optional[pandas.core.frame.DataFrame] = None, dyn_cims: Optional[dict] = None)
                                                                            -

                                                                            Bases: PyCTBN.PyCTBN.utility.abstract_exporter.AbstractExporter

                                                                            -

                                                                            Provides the methods to save in json format a network information -along with one or more trajectories generated basing on it

                                                                            -
                                                                            -
                                                                            Parameters
                                                                            -
                                                                              -
                                                                            • _variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities

                                                                            • -
                                                                            • _dyn_str (pandas.DataFrame) – Dataframe containing the structure of the network (edges)

                                                                            • -
                                                                            • _dyn_cims (dict) – It contains, for every variable (label is the key), the SetOfCims object related to it

                                                                            • -
                                                                            • _trajectories (List) – List of trajectories, that can be added subsequently

                                                                            • -
                                                                            -
                                                                            -
                                                                            -
                                                                            -
                                                                            -cims_to_json()dict
                                                                            -
                                                                            -
                                                                            -
                                                                            -out_file(filename)
                                                                            -
                                                                            -
                                                                            Create a file in current directory and write on it the previously added data

                                                                            (variables, dyn_str, dyn_cims and trajectories)

                                                                            -
                                                                            -
                                                                            -
                                                                            -
                                                                            Parameters
                                                                            -

                                                                            filename (string) – Name of the output file (it must include json extension)

                                                                            -
                                                                            -
                                                                            -
                                                                            + +
                                                                            -
                                                                            - -
                                                                            -

                                                                            PyCTBN.PyCTBN.utility.json_importer module

                                                                            @@ -480,12 +398,14 @@ dataset

                                                                            -
                                                                            -import_data(indx: int)None
                                                                            + +
                                                                            +import_data(indx: int = 0) → None
                                                                            +

                                                                            Implements the abstract method of AbstractImporter.

                                                                            Parameters
                                                                            -

                                                                            indx (int) – the index of the outer JsonArray to extract the data from

                                                                            +

                                                                            indx (int) – the index of the outer JsonArray to extract the data from, default to 0

                                                                            @@ -621,8 +541,8 @@ as keys for the set of CIMS of a particular node.

                                                                            -
                                                                            -
                                                                            + +

                                                                            PyCTBN.PyCTBN.utility.sample_importer module

                                                                            @@ -665,11 +585,11 @@ dataset

                                                                            -
                                                                            -
                                                                            + +

                                                                            Module contents

                                                                            -
                                                                            -
                                                                            + +
                                                                            diff --git a/docs/PyCTBN.html b/docs/PyCTBN.html index e1f1200..a6024f3 100644 --- a/docs/PyCTBN.html +++ b/docs/PyCTBN.html @@ -62,7 +62,7 @@ -

                                                                            Contents:

                                                                            +

                                                                            Contents:

                                                                            • PyCTBN.PyCTBN package
                                                                              • Subpackages
                                                                              • @@ -116,9 +116,9 @@
                                                                                -
                                                                                +

                                                                                PyCTBN package

                                                                                -
                                                                                +

                                                                                Subpackages

                                                                                  @@ -218,20 +218,16 @@
                                                                                -
                                                                                -
                                                                                +
                                                                                +

                                                                                Submodules

                                                                                -
                                                                                -
                                                                                -

                                                                                PyCTBN.basic_main module

                                                                                -
                                                                                -
                                                                                -

                                                                                PyCTBN.setup module

                                                                                -
                                                                                -
                                                                                + + +
                                                                                +

                                                                                Module contents

                                                                                -
                                                                                -
                                                                                + +
                                                                                diff --git a/docs/PyCTBN.tests.estimators.html b/docs/PyCTBN.tests.estimators.html index 08d7a4e..c39f871 100644 --- a/docs/PyCTBN.tests.estimators.html +++ b/docs/PyCTBN.tests.estimators.html @@ -62,7 +62,7 @@ -

                                                                                Contents:

                                                                                +

                                                                                Contents:

                                                                                • PyCTBN.PyCTBN package
                                                                                  • Subpackages
                                                                                  • @@ -116,12 +116,12 @@
                                                                                    -
                                                                                    +

                                                                                    PyCTBN.tests.estimators package

                                                                                    -
                                                                                    +

                                                                                    Submodules

                                                                                    -
                                                                                    -
                                                                                    +
                                                                                    +

                                                                                    PyCTBN.tests.estimators.test_parameters_estimator module

                                                                                    @@ -160,11 +160,40 @@
                                                                                    -
                                                                                    -
                                                                                    -

                                                                                    PyCTBN.tests.estimators.test_structure_constraint_based_estimator module

                                                                                    -
                                                                                    -
                                                                                    + + +
                                                                                    +

                                                                                    PyCTBN.tests.estimators.test_structure_constraint_based_estimator module

                                                                                    +
                                                                                    +
                                                                                    +class PyCTBN.tests.estimators.test_structure_constraint_based_estimator.TestStructureConstraintBasedEstimator(methodName='runTest')
                                                                                    +

                                                                                    Bases: unittest.case.TestCase

                                                                                    +
                                                                                    +
                                                                                    +classmethod setUpClass()
                                                                                    +

                                                                                    Hook method for setting up class fixture before running tests in the class.

                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_1()
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_2()
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_3()
                                                                                    +
                                                                                    + +
                                                                                    + +
                                                                                    +
                                                                                    +

                                                                                    PyCTBN.tests.estimators.test_structure_estimator module

                                                                                    @@ -218,14 +247,47 @@
                                                                                    -
                                                                                    -
                                                                                    -

                                                                                    PyCTBN.tests.estimators.test_structure_score_based_estimator module

                                                                                    -
                                                                                    -
                                                                                    + + +
                                                                                    +

                                                                                    PyCTBN.tests.estimators.test_structure_score_based_estimator module

                                                                                    +
                                                                                    +
                                                                                    +class PyCTBN.tests.estimators.test_structure_score_based_estimator.TestStructureScoreBasedEstimator(methodName='runTest')
                                                                                    +

                                                                                    Bases: unittest.case.TestCase

                                                                                    +
                                                                                    +
                                                                                    +classmethod setUpClass()
                                                                                    +

                                                                                    Hook method for setting up class fixture before running tests in the class.

                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_1()
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_2()
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_3()
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                    +test_structure_monoprocesso()
                                                                                    +
                                                                                    + +
                                                                                    + +
                                                                                    +

                                                                                    Module contents

                                                                                    -
                                                                                    -
                                                                                    + +
                                                                                    diff --git a/docs/PyCTBN.tests.html b/docs/PyCTBN.tests.html index 6364806..57c3a3d 100644 --- a/docs/PyCTBN.tests.html +++ b/docs/PyCTBN.tests.html @@ -62,7 +62,7 @@ -

                                                                                    Contents:

                                                                                    +

                                                                                    Contents:

                                                                                    • PyCTBN.PyCTBN package
                                                                                      • Subpackages
                                                                                      • @@ -116,9 +116,9 @@
                                                                                        -
                                                                                        +

                                                                                        PyCTBN.tests package

                                                                                        -
                                                                                        +

                                                                                        Subpackages

                                                                                          @@ -161,11 +161,11 @@
                                                                                        -
                                                                                        -
                                                                                        +
                                                                                        +

                                                                                        Module contents

                                                                                        -
                                                                                        -
                                                                                        + +
                                                                                        diff --git a/docs/PyCTBN.tests.optimizers.html b/docs/PyCTBN.tests.optimizers.html index 819dcb7..2e20c9a 100644 --- a/docs/PyCTBN.tests.optimizers.html +++ b/docs/PyCTBN.tests.optimizers.html @@ -62,7 +62,7 @@ -

                                                                                        Contents:

                                                                                        +

                                                                                        Contents:

                                                                                        • PyCTBN.PyCTBN package
                                                                                          • Subpackages
                                                                                          • @@ -116,21 +116,65 @@
                                                                                            -
                                                                                            +

                                                                                            PyCTBN.tests.optimizers package

                                                                                            -
                                                                                            +

                                                                                            Submodules

                                                                                            -
                                                                                            -
                                                                                            -

                                                                                            PyCTBN.tests.optimizers.test_hill_climbing_search module

                                                                                            -
                                                                                            -
                                                                                            -

                                                                                            PyCTBN.tests.optimizers.test_tabu_search module

                                                                                            -
                                                                                            -
                                                                                            +
                                                                                            + + +

                                                                                            Module contents

                                                                                            -
                                                                                            -
                                                                                            + +
                                                                                            diff --git a/docs/PyCTBN.tests.structure_graph.html b/docs/PyCTBN.tests.structure_graph.html index 413e89f..581cd0c 100644 --- a/docs/PyCTBN.tests.structure_graph.html +++ b/docs/PyCTBN.tests.structure_graph.html @@ -62,7 +62,7 @@ -

                                                                                            Contents:

                                                                                            +

                                                                                            Contents:

                                                                                            • PyCTBN.PyCTBN package
                                                                                              • Subpackages
                                                                                              • @@ -116,12 +116,12 @@
                                                                                                -
                                                                                                +

                                                                                                PyCTBN.tests.structure_graph package

                                                                                                -
                                                                                                +

                                                                                                Submodules

                                                                                                -
                                                                                                -
                                                                                                +
                                                                                                +

                                                                                                PyCTBN.tests.structure_graph.test_cim module

                                                                                                @@ -150,11 +150,8 @@
                                                                                                -
                                                                                                -
                                                                                                -

                                                                                                PyCTBN.tests.structure_graph.test_networkgenerator module

                                                                                                -
                                                                                                -
                                                                                                + +

                                                                                                PyCTBN.tests.structure_graph.test_networkgraph module

                                                                                                @@ -258,8 +255,8 @@
                                                                                                -
                                                                                                -
                                                                                                + +

                                                                                                PyCTBN.tests.structure_graph.test_sample_path module

                                                                                                @@ -318,8 +315,8 @@
                                                                                                -
                                                                                                -
                                                                                                + +

                                                                                                PyCTBN.tests.structure_graph.test_setofcims module

                                                                                                @@ -375,8 +372,8 @@
                                                                                                -
                                                                                                -
                                                                                                + +

                                                                                                PyCTBN.tests.structure_graph.test_structure module

                                                                                                @@ -430,8 +427,8 @@
                                                                                                -
                                                                                                -
                                                                                                + +

                                                                                                PyCTBN.tests.structure_graph.test_trajectory module

                                                                                                @@ -450,14 +447,12 @@
                                                                                                -
                                                                                                -
                                                                                                -

                                                                                                PyCTBN.tests.structure_graph.test_trajectorygenerator module

                                                                                                -
                                                                                                -
                                                                                                + + +

                                                                                                Module contents

                                                                                                -
                                                                                                -
                                                                                                + +
                                                                                                diff --git a/docs/PyCTBN.tests.utility.html b/docs/PyCTBN.tests.utility.html index f07ec1d..6e10516 100644 --- a/docs/PyCTBN.tests.utility.html +++ b/docs/PyCTBN.tests.utility.html @@ -62,7 +62,7 @@ -

                                                                                                Contents:

                                                                                                +

                                                                                                Contents:

                                                                                                • PyCTBN.PyCTBN package
                                                                                                  • Subpackages
                                                                                                  • @@ -116,12 +116,12 @@
                                                                                                    -
                                                                                                    +

                                                                                                    PyCTBN.tests.utility package

                                                                                                    -
                                                                                                    +

                                                                                                    Submodules

                                                                                                    -
                                                                                                    -
                                                                                                    +
                                                                                                    +

                                                                                                    PyCTBN.tests.utility.test_cache module

                                                                                                    @@ -149,8 +149,8 @@
                                                                                                    -
                                                                                                    -
                                                                                                    + +

                                                                                                    PyCTBN.tests.utility.test_json_importer module

                                                                                                    @@ -259,8 +259,8 @@
                                                                                                    -
                                                                                                    -
                                                                                                    + +

                                                                                                    PyCTBN.tests.utility.test_sample_importer module

                                                                                                    @@ -289,11 +289,11 @@
                                                                                                    -
                                                                                                    -
                                                                                                    + +

                                                                                                    Module contents

                                                                                                    -
                                                                                                    -
                                                                                                    + +
                                                                                                    diff --git a/docs/_sources/examples.rst.txt b/docs/_sources/examples.rst.txt index b1e07c5..5386451 100644 --- a/docs/_sources/examples.rst.txt +++ b/docs/_sources/examples.rst.txt @@ -3,9 +3,9 @@ Examples Installation/Usage ****************** -Download the release in .tar.gz or .whl format and simply use pip install to install it:: +Download the latest release in .tar.gz or .whl format and simply use pip install to install it:: - $pip install PyCTBN-1.0.tar.gz + $pip install PyCTBN-2.2.tar.gz Implementing your own data importer diff --git a/docs/basic_main.html b/docs/basic_main.html index f4aea89..551dae4 100644 --- a/docs/basic_main.html +++ b/docs/basic_main.html @@ -62,7 +62,7 @@ -

                                                                                                    Contents:

                                                                                                    +

                                                                                                    Contents:

                                                                                                    • PyCTBN.PyCTBN package
                                                                                                      • Subpackages
                                                                                                      • @@ -116,9 +116,9 @@
                                                                                                        -
                                                                                                        +

                                                                                                        basic_main module

                                                                                                        -
                                                                                                        +
                                                                                                        diff --git a/docs/examples.html b/docs/examples.html index 00b6942..3f6fa37 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -63,7 +63,7 @@ -

                                                                                                        Contents:

                                                                                                        +

                                                                                                        Contents:

                                                                                                        • PyCTBN.PyCTBN package
                                                                                                          • Subpackages
                                                                                                          • @@ -117,16 +117,16 @@
                                                                                                            -
                                                                                                            +

                                                                                                            Examples

                                                                                                            -
                                                                                                            +

                                                                                                            Installation/Usage

                                                                                                            -

                                                                                                            Download the release in .tar.gz or .whl format and simply use pip install to install it:

                                                                                                            -
                                                                                                            $pip install PyCTBN-1.0.tar.gz
                                                                                                            +

                                                                                                            Download the latest release in .tar.gz or .whl format and simply use pip install to install it:

                                                                                                            +
                                                                                                            $pip install PyCTBN-2.2.tar.gz
                                                                                                             
                                                                                                            -
                                                                                                            -
                                                                                                            +
                                                                                                            +

                                                                                                            Implementing your own data importer

                                                                                                            """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 and no prior net structure.
                                                                                                            @@ -165,8 +165,8 @@
                                                                                                                     pass
                                                                                                             
                                                                                                            -
                                                                                                            -
                                                                                                            +
                                                                                                            +

                                                                                                            Parameters Estimation Example

                                                                                                            from PyCTBN import JsonImporter
                                                                                                             from PyCTBN import SamplePath
                                                                                                            @@ -203,8 +203,8 @@
                                                                                                                 print(sofc1.actual_cims)
                                                                                                             
                                                                                                            -
                                                                                                            -
                                                                                                            + +

                                                                                                            Structure Estimation Example

                                                                                                            from PyCTBN import JsonImporter
                                                                                                             from PyCTBN import SamplePath
                                                                                                            @@ -234,8 +234,8 @@
                                                                                                                 se1.save_results()
                                                                                                             
                                                                                                            -
                                                                                                            -
                                                                                                            + +
                                                                                                            diff --git a/docs/genindex.html b/docs/genindex.html index 152cced..e58c172 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -62,7 +62,7 @@ -

                                                                                                            Contents:

                                                                                                            +

                                                                                                            Contents:

                                                                                                            • PyCTBN.PyCTBN package
                                                                                                              • Subpackages
                                                                                                              • diff --git a/docs/index.html b/docs/index.html index 033f013..8f2e8f1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -63,7 +63,7 @@ -

                                                                                                                Contents:

                                                                                                                +

                                                                                                                Contents:

                                                                                                                • PyCTBN.PyCTBN package
                                                                                                                  • Subpackages
                                                                                                                  • @@ -117,10 +117,10 @@
                                                                                                                    -
                                                                                                                    +

                                                                                                                    Welcome to PyCTBN’s documentation!

                                                                                                                    -

                                                                                                                    Contents:

                                                                                                                    +

                                                                                                                    Contents:

                                                                                                                    -
                                                                                                                    -
                                                                                                                    + +

                                                                                                                    Indices and tables

                                                                                                                    -
                                                                                                                    +
                                                                                                                    diff --git a/docs/modules.html b/docs/modules.html index 6d0881d..1f64d19 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -62,7 +62,7 @@ -

                                                                                                                    Contents:

                                                                                                                    +

                                                                                                                    Contents:

                                                                                                                    • PyCTBN.PyCTBN package
                                                                                                                      • Subpackages
                                                                                                                      • @@ -116,7 +116,7 @@
                                                                                                                        -
                                                                                                                        +

                                                                                                                        PyCTBN

                                                                                                                        -
                                                                                                                        +
                                                                                                                        diff --git a/docs/py-modindex.html b/docs/py-modindex.html index b705bd7..d191c8c 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -65,7 +65,7 @@ -

                                                                                                                        Contents:

                                                                                                                        +

                                                                                                                        Contents:

                                                                                                                        • PyCTBN.PyCTBN package
                                                                                                                          • Subpackages
                                                                                                                          • diff --git a/docs/search.html b/docs/search.html index 7c274f0..32554f6 100644 --- a/docs/search.html +++ b/docs/search.html @@ -62,7 +62,7 @@ -

                                                                                                                            Contents:

                                                                                                                            +

                                                                                                                            Contents:

                                                                                                                            • PyCTBN.PyCTBN package
                                                                                                                              • Subpackages
                                                                                                                              • diff --git a/docs/searchindex.js b/docs/searchindex.js index f2ee99d..f7e966e 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["PyCTBN","PyCTBN.PyCTBN","PyCTBN.PyCTBN.estimators","PyCTBN.PyCTBN.optimizers","PyCTBN.PyCTBN.structure_graph","PyCTBN.PyCTBN.utility","PyCTBN.tests","PyCTBN.tests.estimators","PyCTBN.tests.optimizers","PyCTBN.tests.structure_graph","PyCTBN.tests.utility","basic_main","example","examples","index","modules","setup"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["PyCTBN.rst","PyCTBN.PyCTBN.rst","PyCTBN.PyCTBN.estimators.rst","PyCTBN.PyCTBN.optimizers.rst","PyCTBN.PyCTBN.structure_graph.rst","PyCTBN.PyCTBN.utility.rst","PyCTBN.tests.rst","PyCTBN.tests.estimators.rst","PyCTBN.tests.optimizers.rst","PyCTBN.tests.structure_graph.rst","PyCTBN.tests.utility.rst","basic_main.rst","example.rst","examples.rst","index.rst","modules.rst","setup.rst"],objects:{"":{PyCTBN:[0,0,0,"-"],example:[12,0,0,"-"]},"PyCTBN.PyCTBN":{estimators:[2,0,0,"-"],optimizers:[3,0,0,"-"],structure_graph:[4,0,0,"-"],utility:[5,0,0,"-"]},"PyCTBN.PyCTBN.estimators":{fam_score_calculator:[2,0,0,"-"],parameters_estimator:[2,0,0,"-"],structure_constraint_based_estimator:[2,0,0,"-"],structure_estimator:[2,0,0,"-"],structure_score_based_estimator:[2,0,0,"-"]},"PyCTBN.PyCTBN.estimators.fam_score_calculator":{FamScoreCalculator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.fam_score_calculator.FamScoreCalculator":{get_fam_score:[2,2,1,""],marginal_likelihood_q:[2,2,1,""],marginal_likelihood_theta:[2,2,1,""],single_cim_xu_marginal_likelihood_q:[2,2,1,""],single_cim_xu_marginal_likelihood_theta:[2,2,1,""],single_internal_cim_xxu_marginal_likelihood_theta:[2,2,1,""],variable_cim_xu_marginal_likelihood_q:[2,2,1,""],variable_cim_xu_marginal_likelihood_theta:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator":{ParametersEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[2,2,1,""],compute_state_res_time_for_node:[2,2,1,""],compute_state_transitions_for_a_node:[2,2,1,""],fast_init:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator":{StructureConstraintBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator":{complete_test:[2,2,1,""],compute_thumb_value:[2,2,1,""],ctpc_algorithm:[2,2,1,""],estimate_structure:[2,2,1,""],independence_test:[2,2,1,""],one_iteration_of_CTPC_algorithm:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator":{StructureEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator":{adjacency_matrix:[2,2,1,""],build_complete_graph:[2,2,1,""],build_removable_edges_matrix:[2,2,1,""],estimate_structure:[2,2,1,""],generate_possible_sub_sets_of_size:[2,2,1,""],save_plot_estimated_structure_graph:[2,2,1,""],save_results:[2,2,1,""],spurious_edges:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator":{StructureScoreBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator":{estimate_parents:[2,2,1,""],estimate_structure:[2,2,1,""],get_score_from_graph:[2,2,1,""]},"PyCTBN.PyCTBN.optimizers":{constraint_based_optimizer:[3,0,0,"-"],hill_climbing_search:[3,0,0,"-"],optimizer:[3,0,0,"-"],tabu_search:[3,0,0,"-"]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer":{ConstraintBasedOptimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search":{HillClimbing:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer":{Optimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer.Optimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search":{TabuSearch:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.structure_graph":{conditional_intensity_matrix:[4,0,0,"-"],network_generator:[4,0,0,"-"],network_graph:[4,0,0,"-"],sample_path:[4,0,0,"-"],set_of_cims:[4,0,0,"-"],structure:[4,0,0,"-"],trajectory:[4,0,0,"-"],trajectory_generator:[4,0,0,"-"]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix":{ConditionalIntensityMatrix:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[4,3,1,""],compute_cim_coefficients:[4,2,1,""],state_residence_times:[4,3,1,""],state_transition_matrix:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.network_generator":{NetworkGenerator:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator":{cims:[4,3,1,""],dyn_str:[4,3,1,""],generate_cims:[4,2,1,""],generate_graph:[4,2,1,""],graph:[4,3,1,""],variables:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph":{NetworkGraph:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph":{add_edges:[4,2,1,""],add_nodes:[4,2,1,""],build_p_comb_structure_for_a_node:[4,2,1,""],build_time_columns_filtering_for_a_node:[4,2,1,""],build_time_scalar_indexing_structure_for_a_node:[4,2,1,""],build_transition_filtering_for_a_node:[4,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[4,2,1,""],clear_indexing_filtering_structures:[4,2,1,""],edges:[4,3,1,""],fast_init:[4,2,1,""],get_node_indx:[4,2,1,""],get_ordered_by_indx_set_of_parents:[4,2,1,""],get_parents_by_id:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],has_edge:[4,2,1,""],nodes:[4,3,1,""],nodes_indexes:[4,3,1,""],nodes_values:[4,3,1,""],p_combs:[4,3,1,""],remove_edges:[4,2,1,""],remove_node:[4,2,1,""],time_filtering:[4,3,1,""],time_scalar_indexing_strucure:[4,3,1,""],transition_filtering:[4,3,1,""],transition_scalar_indexing_structure:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path":{SamplePath:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath":{build_structure:[4,2,1,""],build_trajectories:[4,2,1,""],clear_memory:[4,2,1,""],has_prior_net_structure:[4,3,1,""],structure:[4,3,1,""],total_variables_count:[4,3,1,""],trajectories:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims":{SetOfCims:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims":{actual_cims:[4,3,1,""],build_cims:[4,2,1,""],build_times_and_transitions_structures:[4,2,1,""],filter_cims_with_mask:[4,2,1,""],get_cims_number:[4,2,1,""],p_combs:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.structure":{Structure:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.structure.Structure":{add_edge:[4,2,1,""],clean_structure_edges:[4,2,1,""],contains_edge:[4,2,1,""],edges:[4,3,1,""],get_node_id:[4,2,1,""],get_node_indx:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],nodes_indexes:[4,3,1,""],nodes_labels:[4,3,1,""],nodes_values:[4,3,1,""],remove_edge:[4,2,1,""],remove_node:[4,2,1,""],total_variables_number:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory":{Trajectory:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory":{complete_trajectory:[4,3,1,""],size:[4,2,1,""],times:[4,3,1,""],trajectory:[4,3,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory_generator":{TrajectoryGenerator:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory_generator.TrajectoryGenerator":{CTBN_Sample:[4,2,1,""],multi_trajectory:[4,2,1,""],worker:[4,2,1,""]},"PyCTBN.PyCTBN.utility":{abstract_exporter:[5,0,0,"-"],abstract_importer:[5,0,0,"-"],cache:[5,0,0,"-"],json_exporter:[5,0,0,"-"],json_importer:[5,0,0,"-"],sample_importer:[5,0,0,"-"]},"PyCTBN.PyCTBN.utility.abstract_exporter":{AbstractExporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.abstract_exporter.AbstractExporter":{add_trajectory:[5,2,1,""],out_file:[5,2,1,""]},"PyCTBN.PyCTBN.utility.abstract_importer":{AbstractImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter":{build_list_of_samples_array:[5,2,1,""],build_sorter:[5,2,1,""],clear_concatenated_frame:[5,2,1,""],compute_row_delta_in_all_samples_frames:[5,2,1,""],compute_row_delta_sigle_samples_frame:[5,2,1,""],concatenated_samples:[5,3,1,""],dataset_id:[5,2,1,""],file_path:[5,3,1,""],sorter:[5,3,1,""],structure:[5,3,1,""],variables:[5,3,1,""]},"PyCTBN.PyCTBN.utility.cache":{Cache:[5,1,1,""]},"PyCTBN.PyCTBN.utility.cache.Cache":{clear:[5,2,1,""],find:[5,2,1,""],put:[5,2,1,""]},"PyCTBN.PyCTBN.utility.json_exporter":{JsonExporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.json_exporter.JsonExporter":{cims_to_json:[5,2,1,""],out_file:[5,2,1,""]},"PyCTBN.PyCTBN.utility.json_importer":{JsonImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.json_importer.JsonImporter":{build_sorter:[5,2,1,""],clear_data_frame_list:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""],import_sampled_cims:[5,2,1,""],import_structure:[5,2,1,""],import_trajectories:[5,2,1,""],import_variables:[5,2,1,""],normalize_trajectories:[5,2,1,""],one_level_normalizing:[5,2,1,""],read_json_file:[5,2,1,""]},"PyCTBN.PyCTBN.utility.sample_importer":{SampleImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.sample_importer.SampleImporter":{build_sorter:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""]},"PyCTBN.tests":{estimators:[7,0,0,"-"],optimizers:[8,0,0,"-"],structure_graph:[9,0,0,"-"],utility:[10,0,0,"-"]},"PyCTBN.tests.estimators":{test_parameters_estimator:[7,0,0,"-"],test_structure_estimator:[7,0,0,"-"]},"PyCTBN.tests.estimators.test_parameters_estimator":{TestParametersEstimatior:[7,1,1,""]},"PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior":{aux_import_sampled_cims:[7,2,1,""],cim_equality_test:[7,2,1,""],equality_of_cims_of_node:[7,2,1,""],setUpClass:[7,2,1,""],test_compute_parameters_for_node:[7,2,1,""],test_fast_init:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_estimator":{TestStructureEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator":{setUpClass:[7,2,1,""],test_adjacency_matrix:[7,2,1,""],test_build_complete_graph:[7,2,1,""],test_build_removable_edges_matrix:[7,2,1,""],test_generate_possible_sub_sets_of_size:[7,2,1,""],test_init:[7,2,1,""],test_save_plot_estimated_graph:[7,2,1,""],test_save_results:[7,2,1,""],test_time:[7,2,1,""]},"PyCTBN.tests.structure_graph":{test_cim:[9,0,0,"-"],test_networkgraph:[9,0,0,"-"],test_sample_path:[9,0,0,"-"],test_setofcims:[9,0,0,"-"],test_structure:[9,0,0,"-"],test_trajectory:[9,0,0,"-"]},"PyCTBN.tests.structure_graph.test_cim":{TestConditionalIntensityMatrix:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_cim.TestConditionalIntensityMatrix":{setUpClass:[9,2,1,""],test_compute_cim_coefficients:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph":{TestNetworkGraph:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph.TestNetworkGraph":{aux_build_p_combs_structure:[9,2,1,""],aux_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],aux_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],aux_build_transition_columns_filtering_structure:[9,2,1,""],aux_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_add_edges:[9,2,1,""],test_add_nodes:[9,2,1,""],test_build_p_combs_structure:[9,2,1,""],test_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],test_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],test_build_transition_columns_filtering_structure:[9,2,1,""],test_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],test_fast_init:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_ordered_by_indx_set_of_parents:[9,2,1,""],test_get_parents_by_id:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_sample_path":{TestSamplePath:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_sample_path.TestSamplePath":{setUpClass:[9,2,1,""],test_buid_samplepath_no_concatenated_samples:[9,2,1,""],test_buid_samplepath_no_variables:[9,2,1,""],test_build_saplepath_no_prior_net_structure:[9,2,1,""],test_build_structure:[9,2,1,""],test_build_structure_bad_sorter:[9,2,1,""],test_build_trajectories:[9,2,1,""],test_init:[9,2,1,""],test_init_not_filled_dataframse:[9,2,1,""],test_init_not_initialized_importer:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_setofcims":{TestSetOfCims:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_setofcims.TestSetOfCims":{another_filtering_method:[9,2,1,""],aux_test_build_cims:[9,2,1,""],aux_test_init:[9,2,1,""],build_p_comb_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_build_cims:[9,2,1,""],test_filter_cims_with_mask:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_structure":{TestStructure:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_structure.TestStructure":{setUpClass:[9,2,1,""],test_edges_operations:[9,2,1,""],test_equality:[9,2,1,""],test_get_node_id:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_positional_node_indx:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_trajectory":{TestTrajectory:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_trajectory.TestTrajectory":{setUpClass:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.utility":{test_cache:[10,0,0,"-"],test_json_importer:[10,0,0,"-"],test_sample_importer:[10,0,0,"-"]},"PyCTBN.tests.utility.test_cache":{TestCache:[10,1,1,""]},"PyCTBN.tests.utility.test_cache.TestCache":{test_clear:[10,2,1,""],test_find:[10,2,1,""],test_init:[10,2,1,""],test_put:[10,2,1,""]},"PyCTBN.tests.utility.test_json_importer":{TestJsonImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_json_importer.TestJsonImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_build_sorter:[10,2,1,""],test_clear_concatenated_frame:[10,2,1,""],test_clear_data_frame_list:[10,2,1,""],test_compute_row_delta_in_all_frames:[10,2,1,""],test_compute_row_delta_in_all_frames_not_init_sorter:[10,2,1,""],test_compute_row_delta_single_samples_frame:[10,2,1,""],test_dataset_id:[10,2,1,""],test_file_path:[10,2,1,""],test_import_data:[10,2,1,""],test_import_sampled_cims:[10,2,1,""],test_import_structure:[10,2,1,""],test_import_variables:[10,2,1,""],test_init:[10,2,1,""],test_normalize_trajectories:[10,2,1,""],test_normalize_trajectories_wrong_indx:[10,2,1,""],test_normalize_trajectories_wrong_key:[10,2,1,""],test_read_json_file_found:[10,2,1,""],test_read_json_file_not_found:[10,2,1,""]},"PyCTBN.tests.utility.test_sample_importer":{TestSampleImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_sample_importer.TestSampleImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_init:[10,2,1,""],test_order:[10,2,1,""]},PyCTBN:{PyCTBN:[1,0,0,"-"],tests:[6,0,0,"-"]},example:{main:[12,4,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:function"},terms:{"0":[2,4,13],"1":[2,4,13],"10":2,"2":13,"25":2,"3":13,"40":[2,3],"5":2,"abstract":[2,3,4,5,13],"boolean":[2,4],"case":[4,7,9,10],"class":[2,3,4,5,7,9,10,13],"default":[2,3],"do":2,"float":[2,4],"function":2,"import":[4,5,14],"int":[2,3,4,5],"new":5,"null":2,"return":[2,3,4,5,9,13],"static":[2,4],"super":13,"true":[2,13],"var":13,A:[2,3,4,5],For:4,If:[2,3,4,5],It:[2,4,5],NOT:2,The:[2,4,5,13],__actual_cach:5,__generate_cim:4,__init__:13,__list_of_sets_of_par:5,_actual_cim:4,_actual_trajectori:4,_aggregated_info_about_nodes_par:4,_array_indx:5,_cach:2,_cim:4,_complete_graph:2,_df_samples_list:[5,13],_df_structur:5,_df_variabl:[5,13],_dyn_cim:5,_dyn_str:5,_file_path:13,_generated_trajectori:4,_graph:[4,13],_import:4,_indx:4,_label:4,_net_graph:2,_node:2,_node_id:4,_nodes_indx:2,_nodes_v:2,_p_combs_structur:4,_parent:4,_raw_data:5,_sample_path:2,_single_set_of_cim:2,_sorter:[5,13],_state_residence_tim:4,_structur:4,_structure_label:5,_time:4,_time_filt:4,_time_scalar_indexing_structur:4,_total_variables_count:4,_total_variables_numb:4,_trajectori:[4,5],_transition_filt:4,_transition_matric:4,_transition_scalar_indexing_structur:4,_val:4,_variabl:5,_variables_label:5,_vname:4,abc:[3,5],about:[3,4],abstract_export:[0,1,14],abstract_import:[0,1,4,14],abstractexport:5,abstractimport:[4,5,13],accord:4,act:5,actual:[2,4],actual_cim:[4,13],ad:[2,4,5],add:[4,5],add_edg:4,add_nod:4,add_trajectori:5,addit:2,adjac:[2,13],adjacency_matrix:[2,13],after:[4,5],against:2,aggreg:4,algorithm:[2,3,13],all:[2,3,4,5,9,13],allow:4,along:5,alpha_xu:2,alpha_xxu:2,alreadi:[5,13],also:[2,4],an:[2,4,5,13],ani:[2,3],anoth:4,another_filtering_method:9,approach:2,ar:[2,4,5,13],arc:5,arrai:[2,4,5,13],assign:2,assum:2,aux_build_p_combs_structur:9,aux_build_time_columns_filtering_structure_for_a_nod:9,aux_build_time_scalar_indexing_structure_for_a_nod:9,aux_build_transition_columns_filtering_structur:9,aux_build_transition_scalar_indexing_structure_for_a_nod:9,aux_import_sampled_cim:7,aux_test_build_cim:9,aux_test_init:9,axi:13,base:[2,3,4,5,7,9,10],basic_main:15,bayesian:2,been:4,befor:[2,3,7,9,10],belong:[2,4],best:2,between:[4,5],bool:[2,4],both:[2,5],bound:4,build:[2,4,5,9,13],build_cim:4,build_complete_graph:2,build_list_of_samples_arrai:5,build_p_comb_structure_for_a_nod:[4,9],build_removable_edges_matrix:2,build_sort:[5,13],build_structur:[4,13],build_time_columns_filtering_for_a_nod:4,build_time_scalar_indexing_structure_for_a_nod:4,build_times_and_transitions_structur:4,build_trajectori:[4,13],build_transition_filtering_for_a_nod:4,build_transition_scalar_indexing_structure_for_a_nod:4,built:2,cach:[0,1,2,14],calcul:2,call:[5,13],can:5,cardin:[2,4,5,9],cardinalit:[4,5],care:4,caridin:4,caridinalit:4,chang:[4,5],check:4,chi:2,chi_test:2,chi_test_alfa:2,child:[2,3],child_indx:2,child_states_numb:2,child_val:2,cim1:[2,7],cim2:[2,7],cim:[2,4,5,13],cim_equality_test:7,cims_kei:5,cims_label:[5,7],cims_to_json:5,classmethod:[7,9,10],clean_structure_edg:4,clear:[4,5],clear_concatenated_fram:5,clear_data_frame_list:5,clear_indexing_filtering_structur:4,clear_memori:4,climb:[2,3],coeffici:4,col:4,color:2,cols_filt:2,column:[2,4,5,13],columns_head:5,comb:4,combin:[4,5,9],combinatori:[4,9],common:2,complet:[2,4,5],complete_test:2,complete_trajectori:4,comput:[2,3,4,5,13],compute_cim_coeffici:4,compute_parameters_for_nod:[2,13],compute_row_delta_in_all_samples_fram:[5,13],compute_row_delta_sigle_samples_fram:5,compute_state_res_time_for_nod:2,compute_state_transitions_for_a_nod:2,compute_thumb_valu:2,concatanated_sampl:5,concaten:[4,5],concatenated_sampl:5,condit:4,conditional_intensity_matrix:[0,1,2,14],conditionalintensitymatrix:[2,4],consid:[2,4],consider:4,constraint:2,constraint_based_optim:[0,1,14],constraintbasedoptim:3,construct:[4,5,13],conta:5,contain:[2,4,5,9],contains_edg:4,content:15,convent:4,convert:[2,5],copi:5,core:[4,5],correct:[4,5],correspond:4,could:2,count:4,creat:[2,4,5,13],csv:13,csvimport:13,ctbn:2,ctbn_sampl:4,ctpc:[2,3,13],ctpc_algorithm:[2,13],current:[2,3,5],cut:5,dafram:5,data:[2,3,4,5,14],datafram:[4,5,13],dataset:[3,4,5],dataset_id:[5,13],datfram:5,def:13,defin:[4,5],definit:5,defualt:2,delta:[2,4,5],demonstr:13,densiti:4,describ:5,desir:[2,4],df:13,df_samples_list:5,dict:[4,5,13],dictionari:5,differ:5,differt:2,digraph:2,dimens:4,dir:13,direct:[2,4],directli:5,directori:5,disabl:[2,3],disable_multiprocess:2,distribuit:2,doc:5,doubl:4,download:13,drop:13,duplic:4,dyn:13,dyn_cim:[4,5],dyn_str:[4,5],each:[2,3,4,5],edg:[2,4,5,13],edges_list:4,end:[4,5],entir:2,equal:4,equality_of_cims_of_nod:7,est:13,estim:[0,1,3,4,6,14],estimate_par:2,estimate_structur:2,estimated_cim:7,everi:[4,5],exam:13,exampl:[5,14,15],exclud:2,exctract:5,execut:4,exist:[4,5],exp_test_alfa:2,exponenti:2,expos:5,extend:13,extens:[2,5],extract:[4,5],fals:[2,4],fam_score_calcul:[0,1,14],famscor:2,famscorecalcul:2,fast_init:[2,4,13],file:[2,5,13],file_path:[2,5,13],filenam:5,filepath:5,fill:[2,13],filter:[2,4],filter_cims_with_mask:4,find:[2,5],first:[2,13],fix:4,fixtur:[7,9,10],follow:[4,5],form:4,format:[5,13],formula:2,found:5,frame:[4,5],from:[4,5,13],from_nod:5,g1:2,g2:2,g:13,gener:[2,4,5],generate_cim:4,generate_graph:4,generate_possible_sub_sets_of_s:2,get:[2,5],get_cims_numb:4,get_fam_scor:2,get_node_id:4,get_node_indx:4,get_ordered_by_indx_set_of_par:4,get_parents_by_id:4,get_positional_node_indx:4,get_score_from_graph:2,get_states_numb:4,given:[2,4,5],glob:13,graph:[2,4,9,13],graph_struct:4,graphic:2,grid:[4,9],group:4,grpah:13,gz:13,ha:[2,4,5,13],has_edg:4,has_prior_net_structur:4,have:5,header:5,header_column:5,hill:[2,3],hill_climbing_search:[0,1,14],hillclimb:3,hold:[2,4],hook:[7,9,10],how:5,hp:2,hyperparamet:2,hypothesi:2,id:[2,3,5],identifi:[2,4,5],iff:2,implement:[3,4,5,14],import_data:[5,13],import_sampled_cim:5,import_structur:5,import_trajectori:5,import_vari:[5,13],improv:[2,3],includ:[2,5],independ:2,independence_test:2,index:[2,4,5,13,14],indic:4,indx:5,info:[4,13],inform:[3,4,5],init:13,initi:[2,4,5,13],inplac:13,insid:13,instal:14,instanti:4,interest:4,interfac:3,intes:4,isn:4,item:4,iter:[2,3],iterations_numb:[2,3],its:[2,3],join:13,json:[2,5,13],json_export:[0,1,14],json_import:[0,1,14],jsonarrai:5,jsonexport:5,jsonimport:[5,13],just:4,keep:[2,3,5],kei:[4,5],kind:2,knowledg:2,known:2,known_edg:2,label:[2,3,4,5],last:4,lenght:[2,3],level:[2,5],likelihood:2,list:[2,3,4,5,13],list_of_column:4,list_of_edg:4,list_of_nod:4,load:5,loop:2,m:[2,4],m_xu_suff_stat:2,m_xxu_suff_stat:2,made:4,main:[12,13],mandatori:4,margin:2,marginal_likelihood_q:2,marginal_likelihood_theta:2,mask:[4,9],mask_arr:4,matric:[2,4],matrix:[2,4,5,9,13],max_par:[2,3],max_tr:4,max_val:4,maximum:[2,3,4],member:[4,5],mention:4,merg:5,method:[2,4,5,7,9,10],methodnam:[7,9,10],min_val:4,minimum:4,model:2,modul:[14,15],more:5,multi_trajectori:4,multipl:5,multiprocess:2,must:[4,5],n:4,name:[2,4,5,13],ndarrai:[2,4,5],necessari:[2,4,5],nest:5,net:[2,3,4,5,13],net_graph:2,network:[2,4,5],network_gener:[0,1,14],network_graph:[0,1,2,14],networkgener:4,networkgraph:[2,4,13],networkx:2,node:[2,3,4,5,9,13],node_id:[2,3,4,9],node_index:4,node_indx:[2,4],node_st:[4,9],node_states_numb:[4,9],nodes_index:4,nodes_indexes_arr:4,nodes_label:4,nodes_labels_list:4,nodes_numb:4,nodes_vals_arr:4,nodes_valu:[4,13],none:[2,3,4,5,7,9,10,13],normal:5,normalize_trajectori:5,np:[2,5],number:[2,3,4],numpi:[2,4,5,9],obj:[10,13],object:[2,3,4,5,13],obvious:4,one:[4,5],one_iteration_of_ctpc_algorithm:2,one_level_norm:5,onli:5,oper:2,optim:[0,1,2,6,14],optimize_structur:3,option:[2,3,4,5],order:[2,4,5,10],origin:5,original_cols_numb:4,os:13,otherwis:[2,4,5],out:5,out_fil:5,outer:[5,13],output:[4,5],over:2,own:14,p1:13,p_comb:[4,9],p_indx:[4,9],p_val:9,p_valu:9,packag:[14,15],page:14,panda:[4,5,13],parallel:4,param:4,paramet:[2,3,4,5,9,14],parameters_estim:[0,1,14],parametersestim:[2,13],parent:[2,3,4,5],parent_indx:2,parent_label:2,parent_set:2,parent_set_v:2,parent_v:2,parent_valu:9,parents_cardin:4,parents_comb:5,parents_index:4,parents_indx:9,parents_label:[4,9],parents_states_numb:[4,9],parents_v:[4,9],parents_valu:[4,9],part:[2,4],particular:[2,5],pass:13,path:[2,5,13],patienc:[2,3],pd:[5,13],peest:13,perform:2,pip:13,place:5,plot:2,png:2,posit:[4,5],possibl:[2,4],predict:3,prepar:5,present:[2,5],previous:5,print:13,prior:[2,13],prior_net_structur:5,privat:4,probabl:4,process:[2,3,4,5],properli:5,properti:[4,5],provid:[4,5],put:5,pyctbn:13,q:2,q_xx:4,rappres:4,raw:5,raw_data:5,re:4,reach:4,read:[5,13],read_csv:13,read_csv_fil:13,read_fil:13,read_json_fil:5,real:[2,4,5,13],red:2,refer:[4,5],reject:2,rel:4,relat:[4,5],releas:13,remain:5,remov:[2,4,5],remove_edg:4,remove_nod:4,repres:4,represent:2,requir:4,resid:[2,4],respect:4,result:[2,4,5,13],row:4,rtype:4,rule:[2,3],run:[7,9,10],runtest:[7,9,10],s1:13,s:[2,3,4,5],same:[4,5],sampl:[4,5,13],sample_fram:[5,13],sample_import:[0,1,14],sample_path:[0,1,2,14],sampled_cim:7,sampleimport:5,samplepath:[2,4,13],samples_label:5,save:[2,5,13],save_plot_estimated_structure_graph:2,save_result:[2,13],scalar_index:2,scalar_indexes_struct:2,score:2,se1:13,search:[2,3,14],second:2,see:5,select:13,self:[2,5,13],sep:2,sep_set:2,set:[2,4,5,7,9,10],set_of_cim:[0,1,2,5,14],setofcim:[2,4,5,13],setup:15,setupclass:[7,9,10],share:4,shift:[4,5],shifted_cols_head:5,show:2,signific:2,simbol:5,simpl:13,simpli:13,sinc:4,singl:4,single_cim_xu_marginal_likelihood_q:2,single_cim_xu_marginal_likelihood_theta:2,single_internal_cim_xxu_marginal_likelihood_theta:2,size:[2,4],socim:5,sofc1:13,sorter:5,specif:[2,4,13],specifi:4,spuriou:2,spurious_edg:2,start:5,state:[2,4],state_res_tim:4,state_residence_tim:4,state_transition_matrix:4,statist:2,stop:[2,3],str:[2,3,4,5,13],string:[2,3,4,5],structur:[0,1,2,3,5,9,14],structure_constraint_based_estim:[0,1,14],structure_estim:[0,1,3,14],structure_estimation_exampl:13,structure_graph:[0,1,2,5,6,14],structure_label:5,structure_score_based_estim:[0,1,14],structureconstraintbasedestim:2,structureestim:[2,3,13],structurescorebasedestim:2,structut:4,style:2,submodul:[1,6,14,15],subpackag:[14,15],subsequ:5,subset:2,suffici:2,suffuci:2,symbol:[4,5],synthet:5,t:[2,4],t_end:4,t_xu_suff_stat:2,tabu:[2,3],tabu_length:[2,3],tabu_rules_dur:[2,3],tabu_search:[0,1,14],tabusearch:3,take:[4,13],taken:4,tar:13,task:[2,4],tau_xu:2,ternari:13,test:[0,2,15],test_add_edg:9,test_add_nod:9,test_adjacency_matrix:7,test_buid_samplepath_no_concatenated_sampl:9,test_buid_samplepath_no_vari:9,test_build_cim:9,test_build_complete_graph:7,test_build_p_combs_structur:9,test_build_removable_edges_matrix:7,test_build_saplepath_no_prior_net_structur:9,test_build_sort:10,test_build_structur:9,test_build_structure_bad_sort:9,test_build_time_columns_filtering_structure_for_a_nod:9,test_build_time_scalar_indexing_structure_for_a_nod:9,test_build_trajectori:9,test_build_transition_columns_filtering_structur:9,test_build_transition_scalar_indexing_structure_for_a_nod:9,test_cach:[0,6],test_child:2,test_cim:[0,6],test_clear:10,test_clear_concatenated_fram:10,test_clear_data_frame_list:10,test_compute_cim_coeffici:9,test_compute_parameters_for_nod:7,test_compute_row_delta_in_all_fram:10,test_compute_row_delta_in_all_frames_not_init_sort:10,test_compute_row_delta_single_samples_fram:10,test_dataset_id:10,test_edges_oper:9,test_equ:9,test_fast_init:[7,9],test_file_path:10,test_filter_cims_with_mask:9,test_find:10,test_generate_possible_sub_sets_of_s:7,test_get_node_id:9,test_get_node_indx:9,test_get_ordered_by_indx_set_of_par:9,test_get_parents_by_id:9,test_get_positional_node_indx:9,test_get_states_numb:9,test_hill_climbing_search:[0,6],test_import_data:10,test_import_sampled_cim:10,test_import_structur:10,test_import_vari:10,test_init:[7,9,10],test_init_not_filled_dataframs:9,test_init_not_initialized_import:9,test_json_import:[0,6],test_networkgener:[0,6],test_networkgraph:[0,6],test_normalize_trajectori:10,test_normalize_trajectories_wrong_indx:10,test_normalize_trajectories_wrong_kei:10,test_ord:10,test_par:2,test_parameters_estim:[0,6],test_put:10,test_read_json_file_found:10,test_read_json_file_not_found:10,test_repr:9,test_sample_import:[0,6],test_sample_path:[0,6],test_save_plot_estimated_graph:7,test_save_result:7,test_setofcim:[0,6],test_structur:[0,6],test_structure_constraint_based_estim:[0,6],test_structure_estim:[0,6],test_structure_score_based_estim:[0,6],test_tabu_search:[0,6],test_tim:7,test_trajectori:[0,6],test_trajectorygener:[0,6],testcach:10,testcas:[7,9,10],testconditionalintensitymatrix:9,testjsonimport:10,testnetworkgraph:9,testparametersestimatior:7,testsampleimport:10,testsamplepath:9,testsetofcim:9,teststructur:9,teststructureestim:7,testtrajectori:9,th:5,tha:5,therefor:4,theta:2,thi:[2,4,5,13],three:13,threshold:2,thumb:2,thumb_threshold:2,thumb_valu:2,time:[2,4,5,13],time_filt:4,time_kei:5,time_scalar_indexing_strucur:4,timestamp:5,to_nod:5,tot_vars_count:[2,3],total:[2,4],total_variables_count:4,total_variables_numb:4,traj:5,trajecory_head:5,trajectori:[0,1,2,5,13,14],trajectories_kei:5,trajectory_gener:[0,1,14],trajectory_list:5,trajectorygener:4,trajectri:13,transit:[2,4,5],transition_filt:4,transition_matric:4,transition_scalar_indexing_structur:4,tri:5,tupl:4,tutori:5,two:[2,4],type:[2,3,4,5,13],u:2,union:5,uniqu:5,unittest:[7,9,10],unus:4,up:[4,5,7,9,10],us:[2,3,4,5,13],usag:14,util:[0,1,4,6,14],val:4,valid:2,valu:[2,3,4,5,9,13],values_list:13,var_id:2,variabl:[2,3,4,5,13],variable_cardin:5,variable_cim_xu_marginal_likelihood_q:2,variable_cim_xu_marginal_likelihood_theta:2,variable_label:5,variables_kei:5,variables_label:5,vector:[2,4],want:13,when:[2,4],where:[4,5],whether:4,which:[2,3,4,5],whl:13,who:2,without:[2,3],worker:4,write:5,x:[2,4],xx:2,you:[2,5,13],your:14},titles:["PyCTBN package","PyCTBN.PyCTBN package","PyCTBN.PyCTBN.estimators package","PyCTBN.PyCTBN.optimizers package","PyCTBN.PyCTBN.structure_graph package","PyCTBN.PyCTBN.utility package","PyCTBN.tests package","PyCTBN.tests.estimators package","PyCTBN.tests.optimizers package","PyCTBN.tests.structure_graph package","PyCTBN.tests.utility package","basic_main module","example module","Examples","Welcome to PyCTBN\u2019s documentation!","PyCTBN","setup module"],titleterms:{"import":13,abstract_export:5,abstract_import:5,basic_main:[0,11],cach:5,conditional_intensity_matrix:4,constraint_based_optim:3,content:[0,1,2,3,4,5,6,7,8,9,10,14],data:13,document:14,estim:[2,7,13],exampl:[12,13],fam_score_calcul:2,hill_climbing_search:3,implement:13,indic:14,instal:13,json_export:5,json_import:5,modul:[0,1,2,3,4,5,6,7,8,9,10,11,12,16],network_gener:4,network_graph:4,optim:[3,8],own:13,packag:[0,1,2,3,4,5,6,7,8,9,10],paramet:13,parameters_estim:2,pyctbn:[0,1,2,3,4,5,6,7,8,9,10,14,15],s:14,sample_import:5,sample_path:4,set_of_cim:4,setup:[0,16],structur:[4,13],structure_constraint_based_estim:2,structure_estim:2,structure_graph:[4,9],structure_score_based_estim:2,submodul:[0,2,3,4,5,7,8,9,10],subpackag:[0,1,6],tabl:14,tabu_search:3,test:[6,7,8,9,10],test_cach:10,test_cim:9,test_hill_climbing_search:8,test_json_import:10,test_networkgener:9,test_networkgraph:9,test_parameters_estim:7,test_sample_import:10,test_sample_path:9,test_setofcim:9,test_structur:9,test_structure_constraint_based_estim:7,test_structure_estim:7,test_structure_score_based_estim:7,test_tabu_search:8,test_trajectori:9,test_trajectorygener:9,trajectori:4,trajectory_gener:4,usag:13,util:[5,10],welcom:14,your:13}}) \ No newline at end of file +Search.setIndex({docnames:["PyCTBN","PyCTBN.PyCTBN","PyCTBN.PyCTBN.estimators","PyCTBN.PyCTBN.optimizers","PyCTBN.PyCTBN.structure_graph","PyCTBN.PyCTBN.utility","PyCTBN.tests","PyCTBN.tests.estimators","PyCTBN.tests.optimizers","PyCTBN.tests.structure_graph","PyCTBN.tests.utility","basic_main","examples","index","modules","setup"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["PyCTBN.rst","PyCTBN.PyCTBN.rst","PyCTBN.PyCTBN.estimators.rst","PyCTBN.PyCTBN.optimizers.rst","PyCTBN.PyCTBN.structure_graph.rst","PyCTBN.PyCTBN.utility.rst","PyCTBN.tests.rst","PyCTBN.tests.estimators.rst","PyCTBN.tests.optimizers.rst","PyCTBN.tests.structure_graph.rst","PyCTBN.tests.utility.rst","basic_main.rst","examples.rst","index.rst","modules.rst","setup.rst"],objects:{"":{PyCTBN:[0,0,0,"-"]},"PyCTBN.PyCTBN":{estimators:[2,0,0,"-"],optimizers:[3,0,0,"-"],structure_graph:[4,0,0,"-"],utility:[5,0,0,"-"]},"PyCTBN.PyCTBN.estimators":{fam_score_calculator:[2,0,0,"-"],parameters_estimator:[2,0,0,"-"],structure_constraint_based_estimator:[2,0,0,"-"],structure_estimator:[2,0,0,"-"],structure_score_based_estimator:[2,0,0,"-"]},"PyCTBN.PyCTBN.estimators.fam_score_calculator":{FamScoreCalculator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.fam_score_calculator.FamScoreCalculator":{get_fam_score:[2,2,1,""],marginal_likelihood_q:[2,2,1,""],marginal_likelihood_theta:[2,2,1,""],single_cim_xu_marginal_likelihood_q:[2,2,1,""],single_cim_xu_marginal_likelihood_theta:[2,2,1,""],single_internal_cim_xxu_marginal_likelihood_theta:[2,2,1,""],variable_cim_xu_marginal_likelihood_q:[2,2,1,""],variable_cim_xu_marginal_likelihood_theta:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator":{ParametersEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[2,2,1,""],compute_state_res_time_for_node:[2,2,1,""],compute_state_transitions_for_a_node:[2,2,1,""],fast_init:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator":{StructureConstraintBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator":{complete_test:[2,2,1,""],compute_thumb_value:[2,2,1,""],ctpc_algorithm:[2,2,1,""],estimate_structure:[2,2,1,""],independence_test:[2,2,1,""],one_iteration_of_CTPC_algorithm:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator":{StructureEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator":{adjacency_matrix:[2,2,1,""],build_complete_graph:[2,2,1,""],build_removable_edges_matrix:[2,2,1,""],estimate_structure:[2,2,1,""],generate_possible_sub_sets_of_size:[2,2,1,""],save_plot_estimated_structure_graph:[2,2,1,""],save_results:[2,2,1,""],spurious_edges:[2,2,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator":{StructureScoreBasedEstimator:[2,1,1,""]},"PyCTBN.PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator":{estimate_parents:[2,2,1,""],estimate_structure:[2,2,1,""],get_score_from_graph:[2,2,1,""]},"PyCTBN.PyCTBN.optimizers":{constraint_based_optimizer:[3,0,0,"-"],hill_climbing_search:[3,0,0,"-"],optimizer:[3,0,0,"-"],tabu_search:[3,0,0,"-"]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer":{ConstraintBasedOptimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search":{HillClimbing:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer":{Optimizer:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.optimizer.Optimizer":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search":{TabuSearch:[3,1,1,""]},"PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch":{optimize_structure:[3,2,1,""]},"PyCTBN.PyCTBN.structure_graph":{conditional_intensity_matrix:[4,0,0,"-"],network_graph:[4,0,0,"-"],sample_path:[4,0,0,"-"],set_of_cims:[4,0,0,"-"],structure:[4,0,0,"-"],trajectory:[4,0,0,"-"]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix":{ConditionalIntensityMatrix:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[4,2,1,""],compute_cim_coefficients:[4,2,1,""],state_residence_times:[4,2,1,""],state_transition_matrix:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph":{NetworkGraph:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph":{add_edges:[4,2,1,""],add_nodes:[4,2,1,""],build_p_comb_structure_for_a_node:[4,2,1,""],build_time_columns_filtering_for_a_node:[4,2,1,""],build_time_scalar_indexing_structure_for_a_node:[4,2,1,""],build_transition_filtering_for_a_node:[4,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[4,2,1,""],clear_indexing_filtering_structures:[4,2,1,""],edges:[4,2,1,""],fast_init:[4,2,1,""],get_node_indx:[4,2,1,""],get_ordered_by_indx_set_of_parents:[4,2,1,""],get_parents_by_id:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],has_edge:[4,2,1,""],nodes:[4,2,1,""],nodes_indexes:[4,2,1,""],nodes_values:[4,2,1,""],p_combs:[4,2,1,""],remove_edges:[4,2,1,""],remove_node:[4,2,1,""],time_filtering:[4,2,1,""],time_scalar_indexing_strucure:[4,2,1,""],transition_filtering:[4,2,1,""],transition_scalar_indexing_structure:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path":{SamplePath:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath":{build_structure:[4,2,1,""],build_trajectories:[4,2,1,""],clear_memory:[4,2,1,""],has_prior_net_structure:[4,2,1,""],structure:[4,2,1,""],total_variables_count:[4,2,1,""],trajectories:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims":{SetOfCims:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims":{actual_cims:[4,2,1,""],build_cims:[4,2,1,""],build_times_and_transitions_structures:[4,2,1,""],filter_cims_with_mask:[4,2,1,""],get_cims_number:[4,2,1,""],p_combs:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.structure":{Structure:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.structure.Structure":{add_edge:[4,2,1,""],clean_structure_edges:[4,2,1,""],contains_edge:[4,2,1,""],edges:[4,2,1,""],get_node_id:[4,2,1,""],get_node_indx:[4,2,1,""],get_positional_node_indx:[4,2,1,""],get_states_number:[4,2,1,""],nodes_indexes:[4,2,1,""],nodes_labels:[4,2,1,""],nodes_values:[4,2,1,""],remove_edge:[4,2,1,""],remove_node:[4,2,1,""],total_variables_number:[4,2,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory":{Trajectory:[4,1,1,""]},"PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory":{complete_trajectory:[4,2,1,""],size:[4,2,1,""],times:[4,2,1,""],trajectory:[4,2,1,""]},"PyCTBN.PyCTBN.utility":{abstract_importer:[5,0,0,"-"],cache:[5,0,0,"-"],json_importer:[5,0,0,"-"],sample_importer:[5,0,0,"-"]},"PyCTBN.PyCTBN.utility.abstract_importer":{AbstractImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter":{build_list_of_samples_array:[5,2,1,""],build_sorter:[5,2,1,""],clear_concatenated_frame:[5,2,1,""],compute_row_delta_in_all_samples_frames:[5,2,1,""],compute_row_delta_sigle_samples_frame:[5,2,1,""],concatenated_samples:[5,2,1,""],dataset_id:[5,2,1,""],file_path:[5,2,1,""],sorter:[5,2,1,""],structure:[5,2,1,""],variables:[5,2,1,""]},"PyCTBN.PyCTBN.utility.cache":{Cache:[5,1,1,""]},"PyCTBN.PyCTBN.utility.cache.Cache":{clear:[5,2,1,""],find:[5,2,1,""],put:[5,2,1,""]},"PyCTBN.PyCTBN.utility.json_importer":{JsonImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.json_importer.JsonImporter":{build_sorter:[5,2,1,""],clear_data_frame_list:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""],import_sampled_cims:[5,2,1,""],import_structure:[5,2,1,""],import_trajectories:[5,2,1,""],import_variables:[5,2,1,""],normalize_trajectories:[5,2,1,""],one_level_normalizing:[5,2,1,""],read_json_file:[5,2,1,""]},"PyCTBN.PyCTBN.utility.sample_importer":{SampleImporter:[5,1,1,""]},"PyCTBN.PyCTBN.utility.sample_importer.SampleImporter":{build_sorter:[5,2,1,""],dataset_id:[5,2,1,""],import_data:[5,2,1,""]},"PyCTBN.tests":{estimators:[7,0,0,"-"],optimizers:[8,0,0,"-"],structure_graph:[9,0,0,"-"],utility:[10,0,0,"-"]},"PyCTBN.tests.estimators":{test_parameters_estimator:[7,0,0,"-"],test_structure_constraint_based_estimator:[7,0,0,"-"],test_structure_estimator:[7,0,0,"-"],test_structure_score_based_estimator:[7,0,0,"-"]},"PyCTBN.tests.estimators.test_parameters_estimator":{TestParametersEstimatior:[7,1,1,""]},"PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior":{aux_import_sampled_cims:[7,2,1,""],cim_equality_test:[7,2,1,""],equality_of_cims_of_node:[7,2,1,""],setUpClass:[7,2,1,""],test_compute_parameters_for_node:[7,2,1,""],test_fast_init:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_constraint_based_estimator":{TestStructureConstraintBasedEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_constraint_based_estimator.TestStructureConstraintBasedEstimator":{setUpClass:[7,2,1,""],test_structure_1:[7,2,1,""],test_structure_2:[7,2,1,""],test_structure_3:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_estimator":{TestStructureEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator":{setUpClass:[7,2,1,""],test_adjacency_matrix:[7,2,1,""],test_build_complete_graph:[7,2,1,""],test_build_removable_edges_matrix:[7,2,1,""],test_generate_possible_sub_sets_of_size:[7,2,1,""],test_init:[7,2,1,""],test_save_plot_estimated_graph:[7,2,1,""],test_save_results:[7,2,1,""],test_time:[7,2,1,""]},"PyCTBN.tests.estimators.test_structure_score_based_estimator":{TestStructureScoreBasedEstimator:[7,1,1,""]},"PyCTBN.tests.estimators.test_structure_score_based_estimator.TestStructureScoreBasedEstimator":{setUpClass:[7,2,1,""],test_structure_1:[7,2,1,""],test_structure_2:[7,2,1,""],test_structure_3:[7,2,1,""],test_structure_monoprocesso:[7,2,1,""]},"PyCTBN.tests.optimizers":{test_hill_climbing_search:[8,0,0,"-"],test_tabu_search:[8,0,0,"-"]},"PyCTBN.tests.optimizers.test_hill_climbing_search":{TestHillClimbingSearch:[8,1,1,""]},"PyCTBN.tests.optimizers.test_hill_climbing_search.TestHillClimbingSearch":{setUpClass:[8,2,1,""],test_structure:[8,2,1,""],test_structure_3:[8,2,1,""]},"PyCTBN.tests.optimizers.test_tabu_search":{TestTabuSearch:[8,1,1,""]},"PyCTBN.tests.optimizers.test_tabu_search.TestTabuSearch":{setUpClass:[8,2,1,""],test_structure:[8,2,1,""],test_structure_3:[8,2,1,""]},"PyCTBN.tests.structure_graph":{test_cim:[9,0,0,"-"],test_networkgraph:[9,0,0,"-"],test_sample_path:[9,0,0,"-"],test_setofcims:[9,0,0,"-"],test_structure:[9,0,0,"-"],test_trajectory:[9,0,0,"-"]},"PyCTBN.tests.structure_graph.test_cim":{TestConditionalIntensityMatrix:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_cim.TestConditionalIntensityMatrix":{setUpClass:[9,2,1,""],test_compute_cim_coefficients:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph":{TestNetworkGraph:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_networkgraph.TestNetworkGraph":{aux_build_p_combs_structure:[9,2,1,""],aux_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],aux_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],aux_build_transition_columns_filtering_structure:[9,2,1,""],aux_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_add_edges:[9,2,1,""],test_add_nodes:[9,2,1,""],test_build_p_combs_structure:[9,2,1,""],test_build_time_columns_filtering_structure_for_a_node:[9,2,1,""],test_build_time_scalar_indexing_structure_for_a_node:[9,2,1,""],test_build_transition_columns_filtering_structure:[9,2,1,""],test_build_transition_scalar_indexing_structure_for_a_node:[9,2,1,""],test_fast_init:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_ordered_by_indx_set_of_parents:[9,2,1,""],test_get_parents_by_id:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_sample_path":{TestSamplePath:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_sample_path.TestSamplePath":{setUpClass:[9,2,1,""],test_buid_samplepath_no_concatenated_samples:[9,2,1,""],test_buid_samplepath_no_variables:[9,2,1,""],test_build_saplepath_no_prior_net_structure:[9,2,1,""],test_build_structure:[9,2,1,""],test_build_structure_bad_sorter:[9,2,1,""],test_build_trajectories:[9,2,1,""],test_init:[9,2,1,""],test_init_not_filled_dataframse:[9,2,1,""],test_init_not_initialized_importer:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_setofcims":{TestSetOfCims:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_setofcims.TestSetOfCims":{another_filtering_method:[9,2,1,""],aux_test_build_cims:[9,2,1,""],aux_test_init:[9,2,1,""],build_p_comb_structure_for_a_node:[9,2,1,""],setUpClass:[9,2,1,""],test_build_cims:[9,2,1,""],test_filter_cims_with_mask:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_structure":{TestStructure:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_structure.TestStructure":{setUpClass:[9,2,1,""],test_edges_operations:[9,2,1,""],test_equality:[9,2,1,""],test_get_node_id:[9,2,1,""],test_get_node_indx:[9,2,1,""],test_get_positional_node_indx:[9,2,1,""],test_get_states_number:[9,2,1,""],test_init:[9,2,1,""],test_repr:[9,2,1,""]},"PyCTBN.tests.structure_graph.test_trajectory":{TestTrajectory:[9,1,1,""]},"PyCTBN.tests.structure_graph.test_trajectory.TestTrajectory":{setUpClass:[9,2,1,""],test_init:[9,2,1,""]},"PyCTBN.tests.utility":{test_cache:[10,0,0,"-"],test_json_importer:[10,0,0,"-"],test_sample_importer:[10,0,0,"-"]},"PyCTBN.tests.utility.test_cache":{TestCache:[10,1,1,""]},"PyCTBN.tests.utility.test_cache.TestCache":{test_clear:[10,2,1,""],test_find:[10,2,1,""],test_init:[10,2,1,""],test_put:[10,2,1,""]},"PyCTBN.tests.utility.test_json_importer":{TestJsonImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_json_importer.TestJsonImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_build_sorter:[10,2,1,""],test_clear_concatenated_frame:[10,2,1,""],test_clear_data_frame_list:[10,2,1,""],test_compute_row_delta_in_all_frames:[10,2,1,""],test_compute_row_delta_in_all_frames_not_init_sorter:[10,2,1,""],test_compute_row_delta_single_samples_frame:[10,2,1,""],test_dataset_id:[10,2,1,""],test_file_path:[10,2,1,""],test_import_data:[10,2,1,""],test_import_sampled_cims:[10,2,1,""],test_import_structure:[10,2,1,""],test_import_variables:[10,2,1,""],test_init:[10,2,1,""],test_normalize_trajectories:[10,2,1,""],test_normalize_trajectories_wrong_indx:[10,2,1,""],test_normalize_trajectories_wrong_key:[10,2,1,""],test_read_json_file_found:[10,2,1,""],test_read_json_file_not_found:[10,2,1,""]},"PyCTBN.tests.utility.test_sample_importer":{TestSampleImporter:[10,1,1,""]},"PyCTBN.tests.utility.test_sample_importer.TestSampleImporter":{ordered:[10,2,1,""],setUpClass:[10,2,1,""],test_init:[10,2,1,""],test_order:[10,2,1,""]},PyCTBN:{PyCTBN:[1,0,0,"-"],tests:[6,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"abstract":[2,3,4,5,12],"boolean":[2,4],"case":[7,8,9,10],"class":[2,3,4,5,7,8,9,10,12],"default":[2,3,5],"float":2,"function":2,"import":[4,5,13,14],"int":[2,3,4,5],"null":2,"return":[2,3,4,5,9,12],"static":[2,4],"super":12,"true":[2,12],"var":12,HAS:5,Has:[2,4],NOT:2,The:[2,4,5,12],Use:[2,12],__actual_cach:5,__init__:12,__list_of_sets_of_par:5,_actual_cim:4,_actual_trajectori:4,_aggregated_info_about_nodes_par:4,_array_indx:5,_cach:2,_cim:4,_complete_graph:2,_df_samples_list:[5,12],_df_structur:5,_df_variabl:[5,12],_file_path:12,_graph:[4,12],_import:4,_net_graph:2,_node:2,_node_id:4,_nodes_indx:2,_nodes_v:2,_p_combs_structur:4,_raw_data:5,_sample_path:2,_single_set_of_cim:2,_sorter:[5,12],_state_residence_tim:4,_structur:4,_structure_label:5,_time:4,_time_filt:4,_time_scalar_indexing_structur:4,_total_variables_count:4,_total_variables_numb:4,_trajectori:4,_transition_filt:4,_transition_matric:4,_transition_scalar_indexing_structur:4,_variables_label:5,abc:[3,5],about:[3,4],abstract_import:[0,1,4,13,14],abstractimport:[4,5,12],act:5,actual:[2,4],actual_cim:[4,12],add:[4,5],add_edg:4,add_nod:4,added:2,addit:2,adjac:[2,12],adjacency_matrix:[2,12],after:5,against:2,aggreg:4,algorithm:[2,3,12],all:[2,3,4,5,9,12],alpha_xu:2,alpha_xxu:2,alreadi:[5,12],also:[2,4],ani:[2,3],anoth:4,another_filtering_method:9,approach:2,arc:5,arrai:[2,4,5,12],assign:2,assum:2,automat:2,aux_build_p_combs_structur:9,aux_build_time_columns_filtering_structure_for_a_nod:9,aux_build_time_scalar_indexing_structure_for_a_nod:9,aux_build_transition_columns_filtering_structur:9,aux_build_transition_scalar_indexing_structure_for_a_nod:9,aux_import_sampled_cim:7,aux_test_build_cim:9,aux_test_init:9,axi:12,base:[2,3,4,5,7,8,9,10],bayesian:2,befor:[2,3,7,8,9,10],belong:2,best:2,between:5,bool:[2,4],both:[2,5],bound:4,build:[2,4,5,9,12],build_cim:4,build_complete_graph:2,build_list_of_samples_arrai:5,build_p_comb_structure_for_a_nod:[4,9],build_removable_edges_matrix:2,build_sort:[5,12],build_structur:[4,12],build_time_columns_filtering_for_a_nod:4,build_time_scalar_indexing_structure_for_a_nod:4,build_times_and_transitions_structur:4,build_trajectori:[4,12],build_transition_filtering_for_a_nod:4,build_transition_scalar_indexing_structure_for_a_nod:4,built:2,cach:[0,1,2,13,14],calcul:2,call:[5,12],cardin:[2,4,5,9],cardinalit:[4,5],caridin:4,caridinalit:4,chang:[4,5],check:4,chi:2,chi_test:2,chi_test_alfa:2,child:[2,3],child_indx:2,child_states_numb:2,child_val:2,cim1:[2,7],cim2:[2,7],cim:[2,4,5,12],cim_equality_test:7,cims_kei:5,cims_label:7,classmethod:[7,8,9,10],clean_structure_edg:4,clear:[4,5],clear_concatenated_fram:5,clear_data_frame_list:5,clear_indexing_filtering_structur:4,clear_memori:4,climb:[2,3],coeffici:4,col:4,cols_filt:2,column:[2,4,5,12],columns_head:5,comb:4,combin:[4,5,9],combinatori:[4,9],common:2,complet:[2,4,5],complete_test:2,complete_trajectori:4,comput:[2,3,4,5,12],compute_cim_coeffici:4,compute_parameters_for_nod:[2,12],compute_row_delta_in_all_samples_fram:[5,12],compute_row_delta_sigle_samples_fram:5,compute_state_res_time_for_nod:2,compute_state_transitions_for_a_nod:2,compute_thumb_valu:2,concatanated_sampl:5,concaten:[4,5],concatenated_sampl:5,condit:4,conditional_intensity_matrix:[0,1,2,13,14],conditionalintensitymatrix:[2,4],consid:[2,4],constraint:2,constraint_based_optim:[0,1,13,14],constraintbasedoptim:3,construct:[4,5,12],conta:5,contain:[2,4,5,9],contains_edg:4,content:[13,14],convert:[2,5],copi:5,core:5,correct:[4,5],could:2,count:4,creat:[2,4,12],csv:12,csvimport:12,ctbn:2,ctpc:[2,3,12],ctpc_algorithm:[2,12],current:[2,3,5],cut:5,dafram:5,data:[2,3,4,5,13,14],datafram:[4,5,12],dataset:[3,4,5],dataset_id:[5,12],datfram:5,def:12,defin:5,definit:5,defualt:2,delta:[2,4,5],demonstr:12,describ:5,desir:[2,4],df_samples_list:5,dict:[5,12],dictionari:5,differ:5,differt:2,digraph:2,dimens:4,dir:12,direct:[2,4],directli:5,disabl:[2,3],disable_multiprocess:2,distribuit:2,doc:5,doubl:4,download:12,drop:12,duplic:4,dyn:12,each:[2,3,5],edg:[2,4,5,12],edges_list:4,end:5,entir:2,equal:4,equality_of_cims_of_nod:7,est:12,estim:[0,1,3,4,6,13,14],estimate_par:2,estimate_structur:2,estimated_cim:7,everi:[4,5],exam:12,exampl:[5,13,14],exclud:2,exctract:5,exist:5,exp_test_alfa:2,exponenti:2,expos:5,extend:12,extens:[2,5],extract:[4,5],fals:2,fam_score_calcul:[0,1,13,14],famscor:2,famscorecalcul:2,fast_init:[2,4,12],file:[2,5,12],file_path:[2,5,12],filepath:5,fill:[2,12],filter:[2,4],filter_cims_with_mask:4,find:[2,5],first:[2,12],fixtur:[7,8,9,10],follow:[4,5],form:4,format:12,formula:2,found:5,frame:5,from:[4,5,12],from_nod:5,gener:2,generate_possible_sub_sets_of_s:2,get:[2,5],get_cims_numb:4,get_fam_scor:2,get_node_id:4,get_node_indx:4,get_ordered_by_indx_set_of_par:4,get_parents_by_id:4,get_positional_node_indx:4,get_score_from_graph:2,get_states_numb:4,given:[2,4,5],glob:12,graph:[2,4,9,12],graph_struct:4,graphic:2,grid:[4,9],grpah:12,has:[5,12],has_edg:4,has_prior_net_structur:4,have:5,header:5,header_column:5,hill:[2,3],hill_climbing_search:[0,1,13,14],hillclimb:3,hold:[2,4],hook:[7,8,9,10],how:5,hyperparamet:2,hypothesi:2,identifi:[2,4,5],iff:2,implement:[3,5,13,14],import_data:[5,12],import_sampled_cim:5,import_structur:5,import_trajectori:5,import_vari:[5,12],improv:[2,3],includ:2,independ:2,independence_test:2,index:[2,4,5,12,13],indic:[2,4],indx:5,info:[4,12],inform:[3,4],init:12,initi:[2,4,5,12],inplac:12,insid:12,instal:[13,14],interest:4,interfac:3,intes:4,iter:[2,3],iterations_numb:[2,3],its:[2,3],join:12,json:[2,5,12],json_import:[0,1,13,14],jsonarrai:5,jsonimport:[5,12],keep:[2,3,5],kei:5,kind:2,knowledg:2,known:2,known_edg:2,label:[2,3,4,5],latest:12,lenght:[2,3],level:[2,5],likelihood:2,list:[2,3,4,5,12],list_of_column:4,list_of_edg:4,list_of_nod:4,load:5,loop:2,m_xu_suff_stat:2,m_xxu_suff_stat:2,main:12,margin:2,marginal_likelihood_q:2,marginal_likelihood_theta:2,mask:[4,9],mask_arr:4,matric:[2,4],matrix:[2,4,5,9,12],max_par:[2,3],maximum:[2,3],member:[4,5],mention:4,merg:5,method:[2,5,7,8,9,10],methodnam:[7,8,9,10],model:2,modul:[13,14],multipl:5,multiprocess:2,name:[2,4,5,12],ndarrai:[2,4,5],necessari:[2,4,5],nest:5,net:[2,3,4,5,12],net_graph:2,network:[2,4,5],network_graph:[0,1,2,13,14],networkgraph:[2,4,12],networkx:2,node:[2,3,4,5,9,12],node_id:[2,3,4,9],node_index:4,node_indx:[2,4],node_st:[4,9],node_states_numb:[4,9],nodes_index:4,nodes_indexes_arr:4,nodes_label:4,nodes_labels_list:4,nodes_numb:4,nodes_vals_arr:4,nodes_valu:[4,12],none:[2,3,4,5,7,9,10,12],normal:5,normalize_trajectori:5,number:[2,3,4],numpi:[2,4,5,9],obj:[10,12],object:[2,3,4,5,12],one:[4,5],one_iteration_of_ctpc_algorithm:2,one_level_norm:5,onli:5,oper:2,optim:[0,1,2,6,13,14],optimize_structur:3,option:[2,3],order:[2,5,10],origin:5,original_cols_numb:4,otherwis:[2,5],out:5,outer:[5,12],over:2,own:[13,14],p_comb:[4,9],p_indx:[4,9],p_val:9,p_valu:9,packag:[13,14],page:13,panda:[5,12],param:4,paramet:[2,3,4,5,9,13,14],parameters_estim:[0,1,13,14],parametersestim:[2,12],parent:[2,3,4,5],parent_indx:2,parent_label:2,parent_set:2,parent_set_v:2,parent_v:2,parent_valu:9,parents_cardin:4,parents_comb:5,parents_index:4,parents_indx:9,parents_label:[4,9],parents_states_numb:[4,9],parents_v:[4,9],parents_valu:[4,9],part:2,particular:[2,5],pass:12,path:[2,5,12],patienc:[2,3],peest:12,perform:2,pip:12,place:5,plot:2,png:2,posit:[4,5],possibl:[2,4],predict:3,prepar:5,present:[2,5],print:12,prior:[2,12],prior_net_structur:5,process:[2,3,4,5],processes_numb:2,properli:5,properti:[4,5],put:5,pyctbn:12,q_xx:4,rappres:4,raw:5,raw_data:5,read:[5,12],read_csv:12,read_csv_fil:12,read_fil:12,read_json_fil:5,real:[2,4,5,12],refer:[4,5],reject:2,rel:4,relat:5,releas:12,remain:5,remov:[2,4,5],remove_edg:4,remove_nod:4,repres:4,represent:2,res:4,resid:[2,4],result:[2,5,12],rtype:4,rule:[2,3],run:[7,8,9,10],runtest:[7,8,9,10],same:5,sampl:[4,5,12],sample_fram:[5,12],sample_import:[0,1,13,14],sample_path:[0,1,2,13,14],sampled_cim:7,sampleimport:5,samplepath:[2,4,12],samples_label:5,save:[2,12],save_plot_estimated_structure_graph:2,save_result:[2,12],scalar_index:2,scalar_indexes_struct:2,score:2,se1:12,search:[2,3,13],second:2,see:5,select:12,self:[2,5,12],sep:2,sep_set:2,set:[2,4,5,7,8,9,10],set_of_cim:[0,1,2,5,13,14],setofcim:[2,4,5,12],setupclass:[7,8,9,10],shift:[4,5],shifted_cols_head:5,show:2,signific:2,simbol:5,simpl:12,simpli:12,sinc:4,single_cim_xu_marginal_likelihood_q:2,single_cim_xu_marginal_likelihood_theta:2,single_internal_cim_xxu_marginal_likelihood_theta:2,size:[2,4],socim:5,sofc1:12,sorter:5,specif:[2,4,12],spuriou:2,spurious_edg:2,start:5,state:[2,4],state_res_tim:4,state_residence_tim:4,state_transition_matrix:4,statist:2,stop:[2,3],str:[2,3,4,5,12],string:[2,3,4,5],structur:[0,1,2,3,5,9,13,14],structure_constraint_based_estim:[0,1,13,14],structure_estim:[0,1,3,13,14],structure_estimation_exampl:12,structure_graph:[0,1,2,5,6,13,14],structure_label:5,structure_score_based_estim:[0,1,13,14],structureconstraintbasedestim:2,structureestim:[2,3,12],structurescorebasedestim:2,structut:4,style:2,submodul:[1,6,13,14],subpackag:[13,14],subset:2,suffici:2,suffuci:2,symbol:[4,5],synthet:5,t_xu_suff_stat:2,tabu:[2,3],tabu_length:[2,3],tabu_rules_dur:[2,3],tabu_search:[0,1,13,14],tabusearch:3,take:12,tar:12,task:[2,4],tau_xu:2,ternari:12,test:2,test_add_edg:9,test_add_nod:9,test_adjacency_matrix:7,test_buid_samplepath_no_concatenated_sampl:9,test_buid_samplepath_no_vari:9,test_build_cim:9,test_build_complete_graph:7,test_build_p_combs_structur:9,test_build_removable_edges_matrix:7,test_build_saplepath_no_prior_net_structur:9,test_build_sort:10,test_build_structur:9,test_build_structure_bad_sort:9,test_build_time_columns_filtering_structure_for_a_nod:9,test_build_time_scalar_indexing_structure_for_a_nod:9,test_build_trajectori:9,test_build_transition_columns_filtering_structur:9,test_build_transition_scalar_indexing_structure_for_a_nod:9,test_cach:6,test_child:2,test_cim:6,test_clear:10,test_clear_concatenated_fram:10,test_clear_data_frame_list:10,test_compute_cim_coeffici:9,test_compute_parameters_for_nod:7,test_compute_row_delta_in_all_fram:10,test_compute_row_delta_in_all_frames_not_init_sort:10,test_compute_row_delta_single_samples_fram:10,test_dataset_id:10,test_edges_oper:9,test_equ:9,test_fast_init:[7,9],test_file_path:10,test_filter_cims_with_mask:9,test_find:10,test_generate_possible_sub_sets_of_s:7,test_get_node_id:9,test_get_node_indx:9,test_get_ordered_by_indx_set_of_par:9,test_get_parents_by_id:9,test_get_positional_node_indx:9,test_get_states_numb:9,test_hill_climbing_search:6,test_import_data:10,test_import_sampled_cim:10,test_import_structur:10,test_import_vari:10,test_init:[7,9,10],test_init_not_filled_dataframs:9,test_init_not_initialized_import:9,test_json_import:6,test_networkgraph:6,test_normalize_trajectori:10,test_normalize_trajectories_wrong_indx:10,test_normalize_trajectories_wrong_kei:10,test_ord:10,test_par:2,test_parameters_estim:6,test_put:10,test_read_json_file_found:10,test_read_json_file_not_found:10,test_repr:9,test_sample_import:6,test_sample_path:6,test_save_plot_estimated_graph:7,test_save_result:7,test_setofcim:6,test_structur:[6,8],test_structure_1:7,test_structure_2:7,test_structure_3:[7,8],test_structure_constraint_based_estim:6,test_structure_estim:6,test_structure_monoprocesso:7,test_structure_score_based_estim:6,test_tabu_search:6,test_tim:7,test_trajectori:6,testcach:10,testcas:[7,8,9,10],testconditionalintensitymatrix:9,testhillclimbingsearch:8,testjsonimport:10,testnetworkgraph:9,testparametersestimatior:7,testsampleimport:10,testsamplepath:9,testsetofcim:9,teststructur:9,teststructureconstraintbasedestim:7,teststructureestim:7,teststructurescorebasedestim:7,testtabusearch:8,testtrajectori:9,tha:5,theta:2,thi:[2,4,5,12],three:12,threshold:2,thumb:2,thumb_threshold:2,thumb_valu:2,time:[2,4,5,12],time_filt:4,time_kei:5,time_scalar_indexing_strucur:4,timestamp:5,to_nod:5,tot_vars_count:[2,3],total:[2,4],total_variables_count:4,total_variables_numb:4,traj:5,trajecory_head:5,trajectori:[0,1,2,5,12,13,14],trajectories_kei:5,trajectory_list:5,trajectri:12,transit:[2,4,5],transition_filt:4,transition_matric:4,transition_scalar_indexing_structur:4,tri:5,tupl:4,tutori:5,two:2,type:[2,3,4,5,12],union:5,uniqu:5,unittest:[7,8,9,10],unus:4,usag:[13,14],use:[2,12],used:[2,3,4,5],using:[2,3,4,5],util:[0,1,4,6,13,14],valid:2,valu:[2,3,4,5,9,12],values_list:12,var_id:2,variabl:[2,3,4,5,12],variable_cardin:5,variable_cim_xu_marginal_likelihood_q:2,variable_cim_xu_marginal_likelihood_theta:2,variable_label:5,variables_kei:5,variables_label:5,vector:[2,4],want:12,when:2,where:5,which:[2,3,4,5],whl:12,who:2,without:[2,3],you:[2,5,12],your:[13,14]},titles:["PyCTBN package","PyCTBN.PyCTBN package","PyCTBN.PyCTBN.estimators package","PyCTBN.PyCTBN.optimizers package","PyCTBN.PyCTBN.structure_graph package","PyCTBN.PyCTBN.utility package","PyCTBN.tests package","PyCTBN.tests.estimators package","PyCTBN.tests.optimizers package","PyCTBN.tests.structure_graph package","PyCTBN.tests.utility package","basic_main module","Examples","Welcome to PyCTBN\u2019s documentation!","PyCTBN","setup module"],titleterms:{"import":12,abstract_import:5,basic_main:11,cach:5,conditional_intensity_matrix:4,constraint_based_optim:3,content:[0,1,2,3,4,5,6,7,8,9,10],data:12,document:13,estim:[2,7,12],exampl:12,fam_score_calcul:2,hill_climbing_search:3,implement:12,indic:13,instal:12,json_import:5,modul:[0,1,2,3,4,5,6,7,8,9,10,11,15],network_graph:4,optim:[3,8],own:12,packag:[0,1,2,3,4,5,6,7,8,9,10],paramet:12,parameters_estim:2,pyctbn:[0,1,2,3,4,5,6,7,8,9,10,13,14],sample_import:5,sample_path:4,set_of_cim:4,setup:15,structur:[4,12],structure_constraint_based_estim:2,structure_estim:2,structure_graph:[4,9],structure_score_based_estim:2,submodul:[0,2,3,4,5,7,8,9,10],subpackag:[0,1,6],tabl:13,tabu_search:3,test:[6,7,8,9,10],test_cach:10,test_cim:9,test_hill_climbing_search:8,test_json_import:10,test_networkgraph:9,test_parameters_estim:7,test_sample_import:10,test_sample_path:9,test_setofcim:9,test_structur:9,test_structure_constraint_based_estim:7,test_structure_estim:7,test_structure_score_based_estim:7,test_tabu_search:8,test_trajectori:9,trajectori:4,usag:12,util:[5,10],welcom:13,your:12}}) diff --git a/docs/setup.html b/docs/setup.html index 3945a3e..1e64098 100644 --- a/docs/setup.html +++ b/docs/setup.html @@ -62,7 +62,7 @@ -

                                                                                                                                Contents:

                                                                                                                                +

                                                                                                                                Contents:

                                                                                                                                • PyCTBN.PyCTBN package
                                                                                                                                  • Subpackages
                                                                                                                                  • @@ -116,9 +116,9 @@
                                                                                                                                    -
                                                                                                                                    +

                                                                                                                                    setup module

                                                                                                                                    -
                                                                                                                                    +
                                                                                                                                    diff --git a/setup.py b/setup.py index 7cad4ea..58f0226 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup(name='PyCTBN', - version='1.0', + version='2.1', url='https://github.com/philipMartini/PyCTBN', license='MIT', author=['Alessandro Bregoli', 'Filippo Martini','Luca Moretti'],