diff --git a/.gitignore b/.gitignore
index 34f5167..9cf2168 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,13 @@ __pycache__
**/PyCTBN.egg-info
**/results_data
**/.scannerwork
+**/build
+test.py
+test_1.py
+test1.json
+test2.json
+test3.json
+result0.png
+example.json
+test_time.py
.idea
-
diff --git a/PyCTBN/PyCTBN/estimators/parameters_estimator.py b/PyCTBN/PyCTBN/estimators/parameters_estimator.py
index 2430522..a01d549 100644
--- a/PyCTBN/PyCTBN/estimators/parameters_estimator.py
+++ b/PyCTBN/PyCTBN/estimators/parameters_estimator.py
@@ -36,7 +36,8 @@ class ParametersEstimator(object):
"""
p_vals = self._net_graph._aggregated_info_about_nodes_parents[2]
node_states_number = self._net_graph.get_states_number(node_id)
- self._single_set_of_cims = SetOfCims(node_id, p_vals, node_states_number, self._net_graph.p_combs)
+ self._single_set_of_cims = SetOfCims(node_id = node_id, parents_states_number = p_vals,
+ node_states_number = node_states_number, p_combs = self._net_graph.p_combs)
def compute_parameters_for_node(self, node_id: str) -> SetOfCims:
"""Compute the CIMS of the node identified by the label ``node_id``.
diff --git a/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py b/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py
index e1ac09a..d5df8d7 100644
--- a/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py
+++ b/PyCTBN/PyCTBN/structure_graph/conditional_intensity_matrix.py
@@ -14,12 +14,16 @@ class ConditionalIntensityMatrix(object):
:type state_transition_matrix: numpy.ndArray
:_cim: the actual cim of the node
"""
- def __init__(self, state_residence_times: np.array, state_transition_matrix: np.array):
+ def __init__(self, state_residence_times: np.array = None, state_transition_matrix: np.array = None,
+ cim: np.array = None):
"""Constructor Method
"""
self._state_residence_times = state_residence_times
self._state_transition_matrix = state_transition_matrix
- self._cim = self.state_transition_matrix.astype(np.float64)
+ if cim is not None:
+ self._cim = cim
+ else:
+ self._cim = self.state_transition_matrix.astype(np.float64)
def compute_cim_coefficients(self) -> None:
"""Compute the coefficients of the matrix _cim by using the following equality q_xx' = M[x, x'] / T[x].
diff --git a/PyCTBN/PyCTBN/structure_graph/network_generator.py b/PyCTBN/PyCTBN/structure_graph/network_generator.py
new file mode 100644
index 0000000..d10ba9e
--- /dev/null
+++ b/PyCTBN/PyCTBN/structure_graph/network_generator.py
@@ -0,0 +1,130 @@
+from .structure import Structure
+from .network_graph import NetworkGraph
+from .conditional_intensity_matrix import ConditionalIntensityMatrix
+from .set_of_cims import SetOfCims
+import numpy as np
+import pandas as pd
+import random
+
+class NetworkGenerator(object):
+ """Provides the methods to generate a network graph and the CIMs related to it
+ Items in _labels, _vals and _indxs are related, and therefore respect the same order
+
+ :param _labels: List of variables labels that will be part of the network
+ :type _labels: List
+ :param _vals: List of cardinalities of the variables in network (defined in the same order as _labels)
+ :type _vals: List
+ :param _indxs: List of the nodes indexes
+ :type _indxs: List
+ :param _cims: It contains, for each variable label (the key), the SetOfCims object related to it
+ :type _cims: Dict
+ :param _graph: The NetworkGraph object representing the generated structure
+ :type _graph: NetworkGraph
+ """
+
+ def __init__(self, labels, vals):
+ self._labels = labels
+ self._vals = vals
+ self._indxs = np.array([i for i, l in enumerate(labels)])
+ self._graph = None
+ self._cims = None
+
+ def generate_graph(self, density, fixed: bool = False):
+ """Generate the edges according to specified density, and then instantiate the NetworkGraph object
+ to represent the network
+
+ :param density: Probability of an edge between two nodes to exist
+ :type density: float
+ :param fixed: Specifies whether the required density is mandatory or it's just a probability
+ :type fixed: bool
+ """
+
+ if fixed:
+ n_edges = density * len(self._labels) * (len(self._labels) - 1)
+ if not float.is_integer(n_edges):
+ raise RuntimeError("Invalid Density")
+ else:
+ n_edges = int(n_edges)
+ edges = [(i, j) for i in self._labels for j in self._labels if i != j]
+ random.shuffle(edges)
+ edges = edges[:n_edges]
+ else:
+ edges = [(i, j) for i in self._labels for j in self._labels if np.random.binomial(1, density) == 1 and i != j]
+
+ s = Structure(self._labels, self._indxs, self._vals, edges, len(self._labels))
+ self._graph = NetworkGraph(s)
+ self._graph.add_nodes(s.nodes_labels)
+ self._graph.add_edges(s.edges)
+
+ def generate_cims(self, min_val, max_val):
+ """For each node, generate the corresponding SetOfCims. The objective is to group the CIMs
+ (actually generated by private method __generate_cim) according to parents possibles states of every node.
+ This method must obviously be executed after the graph has been generated.
+
+ :param min_val: Minimum value allowed for the coefficients in the CIMs
+ :type min_val: float
+ :param max_val: Maximum value allowed for the coefficients in the CIMs
+ :type max_val: float
+ """
+
+ if self._graph is None:
+ return
+
+ self._cims = {}
+
+ for i, l in enumerate(self._labels):
+ p_info = self._graph.get_ordered_by_indx_set_of_parents(l)
+ combs = self._graph.build_p_comb_structure_for_a_node(p_info[2])
+
+ if len(p_info[0]) != 0:
+ node_cims = []
+ for comb in combs:
+ cim = self.__generate_cim(min_val, max_val, self._vals[i])
+ node_cims.append(ConditionalIntensityMatrix(cim = cim))
+ else:
+ node_cims = []
+ cim = self.__generate_cim(min_val, max_val, self._vals[i])
+ node_cims.append(ConditionalIntensityMatrix(cim = cim))
+
+ self._cims[l] = SetOfCims(node_id = l, parents_states_number = p_info[2], node_states_number = self._vals[i], p_combs = combs,
+ cims = np.array(node_cims))
+
+ def __generate_cim(self, min_val, max_val, shape):
+ """Generate a valid CIM matrix, with coefficients in the range [min_val, max_val] and with dimension [shape, shape]
+
+ :param min_val: Minimum value allowed for the coefficients in the CIMs
+ :type min_val: float
+ :param max_val: Maximum value allowed for the coefficients in the CIMs
+ :type max_val: float
+ :param shape: Number of elements in each dimension of the matrix (this actually is the cardinality of the node)
+ :type shape: int
+ """
+
+ cim = np.empty(shape=(shape, shape))
+ cim[:] = np.nan
+
+ for i, c in enumerate(cim):
+ diag = (max_val - min_val) * np.random.random_sample() + min_val
+ row = np.random.rand(1, len(cim))[0]
+ row /= (sum(row) - row[i])
+ row *= diag
+ row[i] = -1 * diag
+ cim[i] = np.around(row, 4)
+
+ return cim
+
+ @property
+ def graph(self) -> NetworkGraph:
+ return self._graph
+
+ @property
+ def cims(self) -> dict:
+ return self._cims
+
+ @property
+ def dyn_str(self) -> list:
+ return pd.DataFrame([[edge[0], edge[1]] for edge in self._graph.edges], columns = ["From", "To"])
+
+ @property
+ def variables(self) -> list:
+ return pd.DataFrame([[l, self._vals[i]] for i, l in enumerate(self._labels)], columns = ["Name", "Value"])
\ No newline at end of file
diff --git a/PyCTBN/PyCTBN/structure_graph/set_of_cims.py b/PyCTBN/PyCTBN/structure_graph/set_of_cims.py
index 5b2c32a..16d5b1b 100644
--- a/PyCTBN/PyCTBN/structure_graph/set_of_cims.py
+++ b/PyCTBN/PyCTBN/structure_graph/set_of_cims.py
@@ -26,7 +26,8 @@ class SetOfCims(object):
:_actual_cims: the cims of the node
"""
- def __init__(self, node_id: str, parents_states_number: typing.List, node_states_number: int, p_combs: np.ndarray):
+ def __init__(self, node_id: str, parents_states_number: typing.List, node_states_number: int, p_combs: np.ndarray,
+ cims: np.ndarray = None):
"""Constructor Method
"""
self._node_id = node_id
@@ -36,7 +37,11 @@ class SetOfCims(object):
self._state_residence_times = None
self._transition_matrices = None
self._p_combs = p_combs
- self.build_times_and_transitions_structures()
+
+ if cims is not None:
+ self._actual_cims = cims
+ else:
+ self.build_times_and_transitions_structures()
def build_times_and_transitions_structures(self) -> None:
"""Initializes at the correct dimensions the state residence times matrix and the state transition matrices.
@@ -60,7 +65,7 @@ class SetOfCims(object):
:type transition_matrices: numpy.ndArray
"""
for state_res_time_vector, transition_matrix in zip(state_res_times, transition_matrices):
- cim_to_add = ConditionalIntensityMatrix(state_res_time_vector, transition_matrix)
+ cim_to_add = ConditionalIntensityMatrix(state_residence_times = state_res_time_vector, state_transition_matrix = transition_matrix)
cim_to_add.compute_cim_coefficients()
self._actual_cims.append(cim_to_add)
self._actual_cims = np.array(self._actual_cims)
@@ -82,7 +87,7 @@ class SetOfCims(object):
return self._actual_cims
else:
flat_indxs = np.argwhere(np.all(self._p_combs[:, mask_arr] == comb, axis=1)).ravel()
- return self._actual_cims[flat_indxs]
+ return np.array(self._actual_cims)[flat_indxs.astype(int)]
@property
def actual_cims(self) -> np.ndarray:
diff --git a/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py b/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py
new file mode 100644
index 0000000..56e170f
--- /dev/null
+++ b/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py
@@ -0,0 +1,179 @@
+from ..utility.abstract_importer import AbstractImporter
+from .conditional_intensity_matrix import ConditionalIntensityMatrix
+from .set_of_cims import SetOfCims
+from .trajectory import Trajectory
+import numpy as np
+import pandas as pd
+import re
+import json
+from numpy import random
+from multiprocessing import Process, Manager
+
+class TrajectoryGenerator(object):
+ """Provides the methods to generate a trajectory basing on the network defined
+ in the importer.
+
+ :param _importer: the Importer object which contains the imported and processed data
+ :type _importer: AbstractImporter
+ :param _vnames: List of the variables labels that belong to the network
+ :type _vnames: List
+ :param _parents: It contains, for each variable label (the key), the list of related parents labels
+ :type _parents: Dict
+ :param _cims: It contains, for each variable label (the key), the SetOfCims object related to it
+ :type _cims: Dict
+ :param _generated_trajectory: Result of the execution of CTBN_Sample, contains the output trajectory
+ :type _generated_trajectory: pandas.DataFrame
+ """
+
+ def __init__(self, importer: AbstractImporter = None, variables: pd.DataFrame = None, dyn_str: pd.DataFrame = None, dyn_cims: dict = None):
+ """Constructor Method
+ It parses and elaborates the data fetched from importer (if defined, otherwise variables, dyn_str and dyn_cims are used)
+ in order to make the objects structure more suitable for the forthcoming trajectory generation
+ """
+
+ self._importer = importer
+
+ self._vnames = self._importer._df_variables.iloc[:, 0].to_list() if importer is not None else variables.iloc[:, 0].to_list()
+
+ self._parents = {}
+ for v in self._vnames:
+ if importer is not None:
+ self._parents[v] = self._importer._df_structure.where(self._importer._df_structure["To"] == v).dropna()["From"].tolist()
+ else:
+ self._parents[v] = dyn_str.where(dyn_str["To"] == v).dropna()["From"].tolist()
+
+ self._cims = {}
+ if importer is not None:
+ sampled_cims = self._importer._cims
+
+ for v in sampled_cims.keys():
+ p_combs = []
+ v_cims = []
+ for comb in sampled_cims[v].keys():
+ p_combs.append(np.array(re.findall(r"=(\d)", comb)).astype("int"))
+ cim = pd.DataFrame(sampled_cims[v][comb]).to_numpy()
+ v_cims.append(ConditionalIntensityMatrix(cim = cim))
+
+ if importer is not None:
+ sof = SetOfCims(node_id = v, parents_states_number = [self._importer._df_variables.where(self._importer._df_variables["Name"] == p)["Value"] for p in self._parents[v]],
+ node_states_number = self._importer._df_variables.where(self._importer._df_variables["Name"] == v)["Value"], p_combs = np.array(p_combs), cims = v_cims)
+ else:
+ sof = SetOfCims(node_id = v, parents_states_number = [variables.where(variables["Name"] == p)["Value"] for p in self._parents[v]],
+ node_states_number = variables.where(variables["Name"] == v)["Value"], p_combs = np.array(p_combs), cims = v_cims)
+ self._cims[v] = sof
+ else:
+ self._cims = dyn_cims
+
+ def CTBN_Sample(self, 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.
+
+ :param t_end: If defined, the sampling ends when end time is reached
+ :type t_end: float
+ :param max_tr: Parameter taken in consideration in case that t_end isn't defined. It specifies the number of transitions to execute
+ :type max_tr: int
+ """
+
+ t = 0
+ sigma = pd.DataFrame(columns = (["Time"] + self._vnames))
+ sigma.loc[len(sigma)] = [0] + [0 for v in self._vnames]
+ time = np.full(len(self._vnames), np.NaN)
+ n_tr = 0
+ self._generated_trajectory = None
+
+ while True:
+ current_values = sigma.loc[len(sigma) - 1]
+
+ for i in range(0, time.size):
+ if np.isnan(time[i]):
+ n_parents = len(self._parents[self._vnames[i]])
+ cim_obj = self._cims[self._vnames[i]].filter_cims_with_mask(np.array([True for p in self._parents[self._vnames[i]]]),
+ [current_values.at[p] for p in self._parents[self._vnames[i]]])
+
+ if n_parents == 1:
+ cim = cim_obj[current_values.at[self._parents[self._vnames[i]][0]]].cim
+ else:
+ cim = cim_obj[0].cim
+
+ param = -1 * cim[current_values.at[self._vnames[i]]][current_values.at[self._vnames[i]]]
+
+ time[i] = t + random.exponential(scale = param)
+
+ next = time.argmin()
+ t = time[next]
+
+ if (max_tr != -1 and n_tr == max_tr) or (t_end != -1 and t >= t_end):
+ sigma.loc[len(sigma) - 1, self._vnames] = -1
+ self._generated_trajectory = sigma
+ return sigma
+ else:
+ n_parents = len(self._parents[self._vnames[next]])
+ cim_obj = self._cims[self._vnames[next]].filter_cims_with_mask(np.array([True for p in self._parents[self._vnames[next]]]),
+ [current_values.at[p] for p in self._parents[self._vnames[next]]])
+
+ if n_parents == 1:
+ cim = cim_obj[current_values.at[self._parents[self._vnames[next]][0]]].cim
+ else:
+ cim = cim_obj[0].cim
+
+ cim_row = np.array(cim[current_values.at[self._vnames[next]]])
+ cim_row[current_values.at[self._vnames[next]]] = 0
+ cim_row /= sum(cim_row)
+ rand_mult = np.random.multinomial(1, cim_row, size=1)
+
+ new_row = pd.DataFrame(sigma[-1:].values, columns = sigma.columns)
+ new_row.loc[0].at[self._vnames[next]] = np.where(rand_mult[0] == 1)[0][0]
+ new_row.loc[0].at["Time"] = round(t, 4)
+ sigma = sigma.append(new_row, ignore_index = True)
+
+ n_tr += 1
+
+ # undefine variable time
+ time[next] = np.NaN
+ for i, v in enumerate(self._parents):
+ if self._vnames[next] in self._parents[v]:
+ time[i] = np.NaN
+
+ def worker(self, t_end, max_tr, trajectories):
+ """Single process that will be executed in parallel in order to generate one trajectory.
+
+ :param t_end: If defined, the sampling ends when end time is reached
+ :type t_end: float
+ :param max_tr: Parameter taken in consideration in case that t_end isn't defined. It specifies the number of transitions to execute
+ :type max_tr: int
+ :param trajectories: Shared list that contains to which the generated trajectory is added
+ :type trajectories: list
+ """
+
+ trajectory = self.CTBN_Sample(t_end = t_end, max_tr = max_tr)
+ trajectories.append(trajectory)
+
+ def multi_trajectory(self, t_ends: list = None, max_trs: 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
+
+ :param t_ends: List of t_end values for the trajectories that will be generated
+ :type t_ends: list
+ :param max_trs: List of max_tr values for the trajectories that will be generated
+ :type max_trs: list
+ """
+
+ if t_ends is None and max_trs is None:
+ return
+
+ trajectories = Manager().list()
+
+ if t_ends is not None:
+ processes = [Process(target = self.worker, args = (t, -1, trajectories)) for t in t_ends]
+ else:
+ processes = [Process(target = self.worker, args = (-1, m, trajectories)) for m in max_trs]
+
+ for p in processes:
+ p.start()
+
+ for p in processes:
+ p.join()
+
+ return trajectories
\ No newline at end of file
diff --git a/PyCTBN/PyCTBN/utility/abstract_exporter.py b/PyCTBN/PyCTBN/utility/abstract_exporter.py
new file mode 100644
index 0000000..a3e1a28
--- /dev/null
+++ b/PyCTBN/PyCTBN/utility/abstract_exporter.py
@@ -0,0 +1,42 @@
+import json
+import pandas as pd
+import os
+from abc import ABC, abstractmethod
+
+class AbstractExporter(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
+
+ :param _variables: Dataframe containing the nodes labels and cardinalities
+ :type _variables: pandas.DataFrame
+ :param _dyn_str: Dataframe containing the structure of the network (edges)
+ :type _dyn_str: pandas.DataFrame
+ :param _dyn_cims: It contains, for every variable (label is the key), the SetOfCims object related to it
+ :type _dyn_cims: dict
+ :param _trajectories: List of trajectories, that can be added subsequently
+ :type _trajectories: List
+ """
+
+ def __init__(self, variables: pd.DataFrame = None, dyn_str: pd.DataFrame = None, dyn_cims: dict = None):
+ self._variables = variables
+ self._dyn_str = dyn_str
+ self._dyn_cims = dyn_cims
+ self._trajectories = []
+
+ def add_trajectory(self, trajectory: list):
+ """Add a new trajectory to the current list
+
+ :param trajectory: The trajectory to add
+ :type trajectory: pandas.DataFrame
+ """
+
+ self._trajectories.append(trajectory)
+
+ @abstractmethod
+ def out_file(self, filename):
+ """Create a file in current directory and write on it the previously added data
+ (variables, dyn_str, dyn_cims and trajectories)
+
+ :param filename: Name of the output file (it must include json extension)
+ :type filename: string
+ """
\ No newline at end of file
diff --git a/PyCTBN/PyCTBN/utility/json_exporter.py b/PyCTBN/PyCTBN/utility/json_exporter.py
new file mode 100644
index 0000000..43b11da
--- /dev/null
+++ b/PyCTBN/PyCTBN/utility/json_exporter.py
@@ -0,0 +1,75 @@
+import json
+import pandas as pd
+import numpy as np
+import os
+
+from .abstract_exporter import AbstractExporter
+
+class JsonExporter(AbstractExporter):
+ """Provides the methods to save in json format a network information
+ along with one or more trajectories generated basing on it
+
+ :param _variables: Dataframe containing the nodes labels and cardinalities
+ :type _variables: pandas.DataFrame
+ :param _dyn_str: Dataframe containing the structure of the network (edges)
+ :type _dyn_str: pandas.DataFrame
+ :param _dyn_cims: It contains, for every variable (label is the key), the SetOfCims object related to it
+ :type _dyn_cims: dict
+ :param _trajectories: List of trajectories, that can be added subsequently
+ :type _trajectories: List
+ """
+
+ def __init__(self, variables: pd.DataFrame = None, dyn_str: pd.DataFrame = None, dyn_cims: dict = None):
+ self._variables = variables
+ self._dyn_str = dyn_str
+ self._dyn_cims = dyn_cims
+ self._trajectories = []
+
+ def out_file(self, filename):
+ """Create a file in current directory and write on it the previously added data
+ (variables, dyn_str, dyn_cims and trajectories)
+
+ :param filename: Name of the output file (it must include json extension)
+ :type filename: string
+ """
+
+ data = [{
+ "dyn.str": json.loads(self._dyn_str.to_json(orient="records")),
+ "variables": json.loads(self._variables.to_json(orient="records")),
+ "dyn.cims": self.cims_to_json(),
+ "samples": [json.loads(trajectory.to_json(orient="records")) for trajectory in self._trajectories]
+ }]
+
+ path = os.getcwd()
+ with open(path + "/" + filename, "w") as json_file:
+ json.dump(data, json_file)
+
+ """Restructure the CIMs object in order to fit the standard JSON file structure
+ """
+ def cims_to_json(self) -> dict:
+ json_cims = {}
+
+ for i, l in enumerate(self._variables.iloc[:, 0].to_list()):
+ json_cims[l] = {}
+ parents = self._dyn_str.where(self._dyn_str["To"] == l).dropna()["From"].tolist()
+ for j, comb in enumerate(self._dyn_cims[l].p_combs):
+ comb_key = ""
+ if len(parents) != 0:
+ for k, val in enumerate(comb):
+ comb_key += parents[k] + "=" + str(val)
+ if k < len(comb) - 1:
+ comb_key += ","
+ else:
+ comb_key = l
+
+ cim = self._dyn_cims[l].filter_cims_with_mask(np.array([True for p in parents]), comb)
+ if len(parents) == 1:
+ cim = cim[comb[0]].cim
+ elif len(parents) == 0:
+ cim = cim[0].cim
+ else:
+ cim = cim[0].cim
+
+ json_cims[l][comb_key] = [dict([(str(i), val) for i, val in enumerate(row)]) for row in cim]
+
+ return json_cims
\ No newline at end of file
diff --git a/PyCTBN/PyCTBN/utility/json_importer.py b/PyCTBN/PyCTBN/utility/json_importer.py
index 6353c01..781be4d 100644
--- a/PyCTBN/PyCTBN/utility/json_importer.py
+++ b/PyCTBN/PyCTBN/utility/json_importer.py
@@ -33,8 +33,8 @@ class JsonImporter(AbstractImporter):
:type _raw_data: List
"""
- def __init__(self, file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str,
- variables_key: str):
+ def __init__(self, file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str,
+ variables_key: str, cims_label: str = None):
"""Constructor method
.. note::
@@ -45,6 +45,7 @@ class JsonImporter(AbstractImporter):
self._samples_label = samples_label
self._structure_label = structure_label
self._variables_label = variables_label
+ self._cims_label = cims_label
self._time_key = time_key
self._variables_key = variables_key
self._df_samples_list = None
@@ -66,6 +67,9 @@ class JsonImporter(AbstractImporter):
self._df_structure = self.import_structure(self._raw_data)
self._df_variables = self.import_variables(self._raw_data)
+ if self._cims_label != None:
+ self._cims = self._raw_data[indx][self._cims_label]
+
def import_trajectories(self, raw_data: typing.List) -> typing.List:
"""Imports the trajectories from the list of dicts ``raw_data``.
diff --git a/PyCTBN/tests/structure_graph/test_cim.py b/PyCTBN/tests/structure_graph/test_cim.py
index b67cf42..aa9e9fc 100644
--- a/PyCTBN/tests/structure_graph/test_cim.py
+++ b/PyCTBN/tests/structure_graph/test_cim.py
@@ -20,14 +20,16 @@ class TestConditionalIntensityMatrix(unittest.TestCase):
cls.state_transition_matrix[i, i] = np.sum(cls.state_transition_matrix[i])
def test_init(self):
- c1 = ConditionalIntensityMatrix(self.state_res_times, self.state_transition_matrix)
+ c1 = ConditionalIntensityMatrix(state_residence_times = self.state_res_times,
+ state_transition_matrix = self.state_transition_matrix)
self.assertTrue(np.array_equal(self.state_res_times, c1.state_residence_times))
self.assertTrue(np.array_equal(self.state_transition_matrix, c1.state_transition_matrix))
self.assertEqual(c1.cim.dtype, np.float)
self.assertEqual(self.state_transition_matrix.shape, c1.cim.shape)
def test_compute_cim_coefficients(self):
- c1 = ConditionalIntensityMatrix(self.state_res_times, self.state_transition_matrix)
+ c1 = ConditionalIntensityMatrix(state_residence_times = self.state_res_times,
+ state_transition_matrix = self.state_transition_matrix)
c2 = self.state_transition_matrix.astype(np.float)
np.fill_diagonal(c2, c2.diagonal() * -1)
for i in range(0, len(self.state_res_times)):
@@ -41,7 +43,8 @@ class TestConditionalIntensityMatrix(unittest.TestCase):
self.assertTrue(np.isclose(c1.cim[i, j], c2[i, j], 1e01))
def test_repr(self):
- c1 = ConditionalIntensityMatrix(self.state_res_times, self.state_transition_matrix)
+ c1 = ConditionalIntensityMatrix(state_residence_times = self.state_res_times,
+ state_transition_matrix = self.state_transition_matrix)
print(c1)
diff --git a/PyCTBN/tests/structure_graph/test_networkgenerator.py b/PyCTBN/tests/structure_graph/test_networkgenerator.py
new file mode 100644
index 0000000..7b90007
--- /dev/null
+++ b/PyCTBN/tests/structure_graph/test_networkgenerator.py
@@ -0,0 +1,39 @@
+import unittest
+import random
+import numpy as np
+
+from PyCTBN.PyCTBN.structure_graph.network_generator import NetworkGenerator
+
+class TestNetworkGenerator(unittest.TestCase):
+ def test_generate_graph(self):
+ labels = ["U", "V", "W", "X", "Y", "Z"]
+ card = 3
+ vals = [card for l in labels]
+ ng = NetworkGenerator(labels, vals)
+ ng.generate_graph(0.3)
+ self.assertEqual(len(labels), len(ng.graph.nodes))
+ self.assertEqual(len([edge for edge in ng.graph.edges if edge[0] == edge[1]]), 0)
+
+ def test_generate_cims(self):
+ labels = ["U", "V", "W", "X", "Y", "Z"]
+ card = 3
+ vals = [card for l in labels]
+ cim_min = random.uniform(0.5, 5)
+ cim_max = random.uniform(0.5, 5) + cim_min
+ ng = NetworkGenerator(labels, vals)
+ ng.generate_graph(0.3)
+ ng.generate_cims(cim_min, cim_max)
+ self.assertEqual(len(ng.cims), len(labels))
+ self.assertListEqual(list(ng.cims.keys()), labels)
+ for key in ng.cims:
+ p_card = ng.graph.get_ordered_by_indx_set_of_parents(key)[2]
+ comb = ng.graph.build_p_comb_structure_for_a_node(p_card)
+ self.assertEqual(len(ng.cims[key].actual_cims), len(comb))
+ for cim in ng.cims[key].actual_cims:
+ self.assertEqual(sum(c > 0 for c in cim.cim.diagonal()), 0)
+ for i, row in enumerate(cim.cim):
+ # self.assertEqual(round(sum(row) - row[i], 8), round(-1 * row[i], 8))
+ self.assertEqual(sum(c < 0 for c in np.delete(cim.cim[i], i)), 0)
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/PyCTBN/tests/structure_graph/test_setofcims.py b/PyCTBN/tests/structure_graph/test_setofcims.py
index 1435111..d471779 100644
--- a/PyCTBN/tests/structure_graph/test_setofcims.py
+++ b/PyCTBN/tests/structure_graph/test_setofcims.py
@@ -52,7 +52,8 @@ class TestSetOfCims(unittest.TestCase):
def test_filter_cims_with_mask(self):
p_combs = self.build_p_comb_structure_for_a_node(self.possible_cardinalities)
- sofc1 = SetOfCims('X', self.possible_cardinalities, 3, p_combs)
+ sofc1 = SetOfCims(node_id = 'X', parents_states_number = self.possible_cardinalities, node_states_number = 3,
+ p_combs = p_combs)
state_res_times_list = []
transition_matrices_list = []
for i in range(len(p_combs)):
@@ -76,7 +77,8 @@ class TestSetOfCims(unittest.TestCase):
def aux_test_build_cims(self, node_id, p_values, node_states, p_combs):
state_res_times_list = []
transition_matrices_list = []
- so1 = SetOfCims(node_id, p_values, node_states, p_combs)
+ so1 = SetOfCims(node_id = node_id, parents_states_number = p_values, node_states_number = node_states,
+ p_combs = p_combs)
for i in range(len(p_combs)):
state_res_times = np.random.rand(1, node_states)[0]
state_res_times = state_res_times * 1000
@@ -90,7 +92,8 @@ class TestSetOfCims(unittest.TestCase):
self.assertIsNone(so1._state_residence_times)
def aux_test_init(self, node_id, parents_states_number, node_states_number, p_combs):
- sofcims = SetOfCims(node_id, parents_states_number, node_states_number, p_combs)
+ sofcims = SetOfCims(node_id = node_id, parents_states_number = parents_states_number,
+ node_states_number = node_states_number, p_combs = p_combs)
self.assertEqual(sofcims._node_id, node_id)
self.assertTrue(np.array_equal(sofcims._p_combs, p_combs))
self.assertTrue(np.array_equal(sofcims._parents_states_number, parents_states_number))
diff --git a/PyCTBN/tests/structure_graph/test_trajectorygenerator.py b/PyCTBN/tests/structure_graph/test_trajectorygenerator.py
new file mode 100644
index 0000000..a14a748
--- /dev/null
+++ b/PyCTBN/tests/structure_graph/test_trajectorygenerator.py
@@ -0,0 +1,58 @@
+import unittest
+import random
+
+from PyCTBN.PyCTBN.structure_graph.trajectory import Trajectory
+from PyCTBN.PyCTBN.structure_graph.trajectory_generator import TrajectoryGenerator
+from PyCTBN.PyCTBN.utility.json_importer import JsonImporter
+
+class TestTrajectoryGenerator(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls) -> None:
+ cls.j1 = JsonImporter(file_path = "./PyCTBN/test_data/networks_and_trajectories_binary_data_01_3.json", samples_label = "samples",
+ structure_label = "dyn.str", variables_label = "variables",
+ cims_label = "dyn.cims", time_key = "Time",
+ variables_key = "Name")
+ cls.j1.import_data(0)
+
+ def test_init(self):
+ tg = TrajectoryGenerator(self.j1)
+ self.assertEqual(len(tg._vnames), len(self.j1.variables))
+ self.assertIsInstance(tg._vnames, list)
+ self.assertIsInstance(tg._parents, dict)
+ self.assertIsInstance(tg._cims, dict)
+ self.assertListEqual(list(tg._parents.keys()), tg._vnames)
+ self.assertListEqual(list(tg._cims.keys()), tg._vnames)
+
+ def test_generated_trajectory(self):
+ tg = TrajectoryGenerator(self.j1)
+ end_time = random.randint(5, 100)
+ sigma = tg.CTBN_Sample(end_time)
+ traj = Trajectory(self.j1.build_list_of_samples_array(sigma), len(self.j1.sorter) + 1)
+ self.assertLessEqual(traj.times[len(traj.times) - 1], end_time)
+ for index in range(len(traj.times)):
+ if index > 0:
+ self.assertLess(traj.times[index - 1], traj.times[index])
+ if index < len(traj.times) - 1:
+ diff = abs(sum(traj.trajectory[index - 1]) - sum(traj.trajectory[index]))
+ self.assertEqual(diff, 1)
+ self.assertEqual(sum(traj.trajectory[len(traj.times) - 1]), -1 * len(self.j1.sorter))
+
+ def test_generated_trajectory_max_tr(self):
+ tg = TrajectoryGenerator(self.j1)
+ n_tr = random.randint(5, 100)
+ sigma = tg.CTBN_Sample(max_tr = n_tr)
+ traj = Trajectory(self.j1.build_list_of_samples_array(sigma), len(self.j1.sorter) + 1)
+ self.assertEqual(len(traj.times), n_tr + 1)
+
+ def test_multi_trajectory(self):
+ tg = TrajectoryGenerator(self.j1)
+ max_trs = [random.randint(5, 100) for i in range(10)]
+ trajectories = tg.multi_trajectory(max_trs = max_trs)
+ self.assertEqual(len(trajectories), len(max_trs))
+ self.assertTrue({len(trajectory) for trajectory in trajectories} == {max_tr + 1 for max_tr in max_trs})
+ t_ends = [random.randint(100, 500) for i in range(10)]
+ trajectories = tg.multi_trajectory(t_ends = t_ends)
+ self.assertEqual(len(trajectories), len(t_ends))
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/PyCTBN/tests/utility/test_cache.py b/PyCTBN/tests/utility/test_cache.py
index e799728..4f0c47f 100644
--- a/PyCTBN/tests/utility/test_cache.py
+++ b/PyCTBN/tests/utility/test_cache.py
@@ -19,13 +19,13 @@ class TestCache(unittest.TestCase):
def test_put(self):
c1 = Cache()
pset1 = {'X', 'Y'}
- sofc1 = SetOfCims('Z', [], 3, np.array([]))
+ sofc1 = SetOfCims(node_id = 'Z', parents_states_number = [], node_states_number = 3, p_combs = np.array([]))
c1.put(pset1, sofc1)
self.assertEqual(1, len(c1._actual_cache))
self.assertEqual(1, len(c1._list_of_sets_of_parents))
self.assertEqual(sofc1, c1._actual_cache[0])
pset2 = {'X'}
- sofc2 = SetOfCims('Z', [], 3, np.array([]))
+ sofc2 = SetOfCims(node_id = 'Z', parents_states_number = [], node_states_number = 3, p_combs = np.array([]))
c1.put(pset2, sofc2)
self.assertEqual(2, len(c1._actual_cache))
self.assertEqual(2, len(c1._list_of_sets_of_parents))
@@ -34,7 +34,7 @@ class TestCache(unittest.TestCase):
def test_find(self):
c1 = Cache()
pset1 = {'X', 'Y'}
- sofc1 = SetOfCims('Z', [], 3, np.array([]))
+ sofc1 = SetOfCims(node_id = 'Z', parents_states_number = [], node_states_number = 3, p_combs = np.array([]))
c1.put(pset1, sofc1)
self.assertEqual(1, len(c1._actual_cache))
self.assertEqual(1, len(c1._list_of_sets_of_parents))
diff --git a/PyCTBN/tests/utility/test_json_exporter.py b/PyCTBN/tests/utility/test_json_exporter.py
new file mode 100644
index 0000000..4c0c94f
--- /dev/null
+++ b/PyCTBN/tests/utility/test_json_exporter.py
@@ -0,0 +1,28 @@
+import unittest
+import random
+import numpy as np
+import os.path
+
+from PyCTBN.PyCTBN.utility.json_exporter import JsonExporter
+from PyCTBN.PyCTBN.structure_graph.trajectory_generator import TrajectoryGenerator
+from PyCTBN.PyCTBN.structure_graph.network_generator import NetworkGenerator
+
+class TestJSONExporter(unittest.TestCase):
+ def test_generate_graph(self):
+ ng = NetworkGenerator(["X", "Y", "Z"], [3 for i in range(3)])
+ ng.generate_graph(0.3)
+ ng.generate_cims(1, 3)
+ e1 = JsonExporter(ng.variables, ng.dyn_str, ng.cims)
+ tg = TrajectoryGenerator(variables = ng.variables, dyn_str = ng.dyn_str, dyn_cims = ng.cims)
+ n_traj = random.randint(1, 30)
+ for i in range(n_traj):
+ sigma = tg.CTBN_Sample(max_tr = 100)
+ e1.add_trajectory(sigma)
+
+ self.assertEqual(n_traj, len(e1._trajectories))
+ e1.out_file("test.json")
+
+ self.assertTrue(os.path.isfile("test.json"))
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/docs-out/PyCTBN.PyCTBN.structure_graph.rst b/docs-out/PyCTBN.PyCTBN.structure_graph.rst
index c236017..f00477b 100644
--- a/docs-out/PyCTBN.PyCTBN.structure_graph.rst
+++ b/docs-out/PyCTBN.PyCTBN.structure_graph.rst
@@ -12,6 +12,14 @@ PyCTBN.PyCTBN.structure\_graph.conditional\_intensity\_matrix module
:undoc-members:
:show-inheritance:
+PyCTBN.PyCTBN.structure\_graph.network\_generator module
+--------------------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.structure_graph.network_generator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.PyCTBN.structure\_graph.network\_graph module
----------------------------------------------------
@@ -52,6 +60,14 @@ PyCTBN.PyCTBN.structure\_graph.trajectory module
:undoc-members:
:show-inheritance:
+PyCTBN.PyCTBN.structure\_graph.trajectory\_generator module
+-----------------------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.structure_graph.trajectory_generator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
Module contents
---------------
diff --git a/docs-out/PyCTBN.PyCTBN.utility.rst b/docs-out/PyCTBN.PyCTBN.utility.rst
index 1a8a33d..d804edf 100644
--- a/docs-out/PyCTBN.PyCTBN.utility.rst
+++ b/docs-out/PyCTBN.PyCTBN.utility.rst
@@ -4,6 +4,14 @@ PyCTBN.PyCTBN.utility package
Submodules
----------
+PyCTBN.PyCTBN.utility.abstract\_exporter module
+-----------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.utility.abstract_exporter
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.PyCTBN.utility.abstract\_importer module
-----------------------------------------------
@@ -20,6 +28,14 @@ PyCTBN.PyCTBN.utility.cache module
:undoc-members:
:show-inheritance:
+PyCTBN.PyCTBN.utility.json\_exporter module
+-------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.utility.json_exporter
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.PyCTBN.utility.json\_importer module
-------------------------------------------
diff --git a/docs-out/PyCTBN.rst b/docs-out/PyCTBN.rst
index db94109..3aaa3ce 100644
--- a/docs-out/PyCTBN.rst
+++ b/docs-out/PyCTBN.rst
@@ -8,10 +8,27 @@ Subpackages
:maxdepth: 4
PyCTBN.PyCTBN
+ PyCTBN.tests
Submodules
----------
+PyCTBN.basic\_main module
+-------------------------
+
+.. automodule:: PyCTBN.basic_main
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+PyCTBN.setup module
+-------------------
+
+.. automodule:: PyCTBN.setup
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
Module contents
---------------
diff --git a/docs-out/PyCTBN.tests.structure_graph.rst b/docs-out/PyCTBN.tests.structure_graph.rst
index 257d48d..7240498 100644
--- a/docs-out/PyCTBN.tests.structure_graph.rst
+++ b/docs-out/PyCTBN.tests.structure_graph.rst
@@ -12,6 +12,14 @@ PyCTBN.tests.structure\_graph.test\_cim module
:undoc-members:
:show-inheritance:
+PyCTBN.tests.structure\_graph.test\_networkgenerator module
+-----------------------------------------------------------
+
+.. automodule:: PyCTBN.tests.structure_graph.test_networkgenerator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.tests.structure\_graph.test\_networkgraph module
-------------------------------------------------------
@@ -52,6 +60,14 @@ PyCTBN.tests.structure\_graph.test\_trajectory module
:undoc-members:
:show-inheritance:
+PyCTBN.tests.structure\_graph.test\_trajectorygenerator module
+--------------------------------------------------------------
+
+.. automodule:: PyCTBN.tests.structure_graph.test_trajectorygenerator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
Module contents
---------------
diff --git a/docs-out/example.rst b/docs-out/example.rst
new file mode 100644
index 0000000..7789de1
--- /dev/null
+++ b/docs-out/example.rst
@@ -0,0 +1,7 @@
+example module
+==============
+
+.. automodule:: example
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs-out/modules.rst b/docs-out/modules.rst
index 4ec310b..aa7e7d5 100644
--- a/docs-out/modules.rst
+++ b/docs-out/modules.rst
@@ -4,5 +4,6 @@ PyCTBN
.. toctree::
:maxdepth: 4
- PyCTBN.PyCTBN
- examples
+ PyCTBN
+ example
+ setup
diff --git a/docs/.buildinfo b/docs/.buildinfo
new file mode 100644
index 0000000..13582d3
--- /dev/null
+++ b/docs/.buildinfo
@@ -0,0 +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: 87e83150455399004cf3d149c3abeafb
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/.doctrees/PyCTBN.PyCTBN.doctree b/docs/.doctrees/PyCTBN.PyCTBN.doctree
new file mode 100644
index 0000000..0422341
Binary files /dev/null and b/docs/.doctrees/PyCTBN.PyCTBN.doctree differ
diff --git a/docs/.doctrees/PyCTBN.PyCTBN.estimators.doctree b/docs/.doctrees/PyCTBN.PyCTBN.estimators.doctree
new file mode 100644
index 0000000..7d01b2b
Binary files /dev/null and b/docs/.doctrees/PyCTBN.PyCTBN.estimators.doctree differ
diff --git a/docs/.doctrees/PyCTBN.PyCTBN.optimizers.doctree b/docs/.doctrees/PyCTBN.PyCTBN.optimizers.doctree
new file mode 100644
index 0000000..70c7b60
Binary files /dev/null and b/docs/.doctrees/PyCTBN.PyCTBN.optimizers.doctree differ
diff --git a/docs/.doctrees/PyCTBN.PyCTBN.structure_graph.doctree b/docs/.doctrees/PyCTBN.PyCTBN.structure_graph.doctree
new file mode 100644
index 0000000..eb16c24
Binary files /dev/null and b/docs/.doctrees/PyCTBN.PyCTBN.structure_graph.doctree differ
diff --git a/docs/.doctrees/PyCTBN.PyCTBN.utility.doctree b/docs/.doctrees/PyCTBN.PyCTBN.utility.doctree
new file mode 100644
index 0000000..5f796fc
Binary files /dev/null and b/docs/.doctrees/PyCTBN.PyCTBN.utility.doctree differ
diff --git a/docs/.doctrees/PyCTBN.doctree b/docs/.doctrees/PyCTBN.doctree
new file mode 100644
index 0000000..2a2f60e
Binary files /dev/null and b/docs/.doctrees/PyCTBN.doctree differ
diff --git a/docs/.doctrees/PyCTBN.tests.doctree b/docs/.doctrees/PyCTBN.tests.doctree
new file mode 100644
index 0000000..fefc2ba
Binary files /dev/null and b/docs/.doctrees/PyCTBN.tests.doctree differ
diff --git a/docs/.doctrees/PyCTBN.tests.estimators.doctree b/docs/.doctrees/PyCTBN.tests.estimators.doctree
new file mode 100644
index 0000000..80596df
Binary files /dev/null and b/docs/.doctrees/PyCTBN.tests.estimators.doctree differ
diff --git a/docs/.doctrees/PyCTBN.tests.optimizers.doctree b/docs/.doctrees/PyCTBN.tests.optimizers.doctree
new file mode 100644
index 0000000..3ff3f0f
Binary files /dev/null and b/docs/.doctrees/PyCTBN.tests.optimizers.doctree differ
diff --git a/docs/.doctrees/PyCTBN.tests.structure_graph.doctree b/docs/.doctrees/PyCTBN.tests.structure_graph.doctree
new file mode 100644
index 0000000..7eca987
Binary files /dev/null and b/docs/.doctrees/PyCTBN.tests.structure_graph.doctree differ
diff --git a/docs/.doctrees/PyCTBN.tests.utility.doctree b/docs/.doctrees/PyCTBN.tests.utility.doctree
new file mode 100644
index 0000000..b283295
Binary files /dev/null and b/docs/.doctrees/PyCTBN.tests.utility.doctree differ
diff --git a/docs/.doctrees/basic_main.doctree b/docs/.doctrees/basic_main.doctree
new file mode 100644
index 0000000..f4ece6f
Binary files /dev/null and b/docs/.doctrees/basic_main.doctree differ
diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle
new file mode 100644
index 0000000..7c761fd
Binary files /dev/null and b/docs/.doctrees/environment.pickle differ
diff --git a/docs/.doctrees/example.doctree b/docs/.doctrees/example.doctree
new file mode 100644
index 0000000..155306f
Binary files /dev/null and b/docs/.doctrees/example.doctree differ
diff --git a/docs/.doctrees/examples.doctree b/docs/.doctrees/examples.doctree
new file mode 100644
index 0000000..7809651
Binary files /dev/null and b/docs/.doctrees/examples.doctree differ
diff --git a/docs/.doctrees/index.doctree b/docs/.doctrees/index.doctree
new file mode 100644
index 0000000..32f7ba4
Binary files /dev/null and b/docs/.doctrees/index.doctree differ
diff --git a/docs/.doctrees/modules.doctree b/docs/.doctrees/modules.doctree
new file mode 100644
index 0000000..b00fadd
Binary files /dev/null and b/docs/.doctrees/modules.doctree differ
diff --git a/docs/.doctrees/setup.doctree b/docs/.doctrees/setup.doctree
new file mode 100644
index 0000000..955f85e
Binary files /dev/null and b/docs/.doctrees/setup.doctree differ
diff --git a/docs/PyCTBN.PyCTBN.estimators.html b/docs/PyCTBN.PyCTBN.estimators.html
index 744c567..1644fa4 100644
--- a/docs/PyCTBN.PyCTBN.estimators.html
+++ b/docs/PyCTBN.PyCTBN.estimators.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -123,13 +127,13 @@
Bases: Has the task of calculating the FamScore of a node by using a Bayesian score function Calculate the FamScore value of the node Calculate the value of the marginal likelihood over q of the node identified by the label node_id Calculate the FamScore value of the node identified by the label node_id Calculate the marginal likelihood on q of the node when assumes a specif value
and a specif parents’s assignmentPyCTBN.PyCTBN.estimators.fam_score_calculator module¶
-
PyCTBN.PyCTBN.estimators.fam_score_calculator.
FamScoreCalculator
¶object
-
get_fam_score
(cims: numpy.array, tau_xu: float = 0.1, alpha_xu: float = 1)¶
-
marginal_likelihood_q
(cims: numpy.array, tau_xu: float = 0.1, alpha_xu: float = 1)¶
-
marginal_likelihood_theta
(cims: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, alpha_xu: float, alpha_xxu: float)¶
-
single_cim_xu_marginal_likelihood_q
(M_xu_suff_stats: float, T_xu_suff_stats: float, tau_xu: float = 0.1, alpha_xu: float = 1)¶
@@ -215,8 +219,8 @@ and a specif parents’s assignment
single_cim_xu_marginal_likelihood_theta
(index: int, cim: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, alpha_xu: float, alpha_xxu: float)¶Calculate the marginal likelihood on q of the node when assumes a specif value and a specif parents’s assignment
single_internal_cim_xxu_marginal_likelihood_theta
(M_xxu_suff_stats: float, alpha_xxu: float = 1)¶Calculate the second part of the marginal likelihood over theta formula
variable_cim_xu_marginal_likelihood_q
(cim: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, tau_xu: float = 0.1, alpha_xu: float = 1)¶Calculate the value of the marginal likelihood over q given a cim
variable_cim_xu_marginal_likelihood_theta
(cim: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, alpha_xu: float, alpha_xxu: float)¶Calculate the value of the marginal likelihood over theta given a cim
PyCTBN.PyCTBN.estimators.parameters_estimator.
ParametersEstimator
(trajectories: PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory, net_graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph)¶Bases: object
Has the task of computing the cims of particular node given the trajectories and the net structure
in the graph _net_graph
.
_net_g
compute_parameters_for_node
(node_id: str) → PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims¶Compute the CIMS of the node identified by the label node_id
.
_net_g
compute_state_res_time_for_node
(times: numpy.ndarray, trajectory: numpy.ndarray, cols_filter: numpy.ndarray, scalar_indexes_struct: numpy.ndarray, T: numpy.ndarray) → None¶Compute the state residence times for a node and fill the matrix T
with the results
_net_g
compute_state_transitions_for_a_node
(node_indx: int, trajectory: numpy.ndarray, cols_filter: numpy.ndarray, scalar_indexing: numpy.ndarray, M: numpy.ndarray) → None¶Compute the state residence times for a node and fill the matrices M
with the results.
_net_g
fast_init
(node_id: str) → None¶Initializes all the necessary structures for the parameters estimation for the node node_id
.
_net_g
PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator module¶
--
-class
PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.
StructureConstraintBasedEstimator
(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, exp_test_alfa: float, chi_test_alfa: float, known_edges: List = [], thumb_threshold: int = 25)¶
+-
+class PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, exp_test_alfa: float, chi_test_alfa: float, known_edges: List = [], thumb_threshold: int = 25)¶
Bases: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator
Has the task of estimating the network structure given the trajectories in samplepath by using a constraint-based approach.
@@ -420,8 +424,8 @@ in the graph _net_g
--
-
complete_test
(test_parent: str, test_child: str, parent_set: List, child_states_numb: int, tot_vars_count: int, parent_indx, child_indx) → bool¶
+-
+complete_test(test_parent: str, test_child: str, parent_set: List, child_states_numb: int, tot_vars_count: int, parent_indx, child_indx) → bool¶
Performs a complete independence test on the directed graphs G1 = {test_child U parent_set}
G2 = {G1 U test_parent} (added as an additional parent of the test_child).
Generates all the necessary structures and datas to perform the tests.
@@ -445,8 +449,8 @@ Generates all the necessary structures and datas to perform the tests.
--
-
compute_thumb_value
(parent_val, child_val, parent_set_vals)¶
+-
+compute_thumb_value(parent_val, child_val, parent_set_vals)¶
Compute the value to test against the thumb_threshold.
- Parameters
@@ -466,8 +470,10 @@ Generates all the necessary structures and datas to perform the tests.
+
-
ctpc_algorithm
(disable_multiprocessing: bool = False, processes_number: int = None)¶
+
Compute the CTPC algorithm over the entire net.
- Parameters
@@ -482,9 +488,11 @@ Generates all the necessary structures and datas to perform the tests.
+
-
estimate_structure
(disable_multiprocessing: bool = False, processes_number: int = None)¶
Compute the constraint-based algorithm to find the optimal structure
+
- Parameters
@@ -498,8 +506,8 @@ Generates all the necessary structures and datas to perform the tests.
--
-
independence_test
(child_states_numb: int, cim1: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, cim2: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, thumb_value: float, parent_indx, child_indx) → bool¶
+-
+independence_test(child_states_numb: int, cim1: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, cim2: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, thumb_value: float, parent_indx, child_indx) → bool¶
Compute the actual independence test using two cims.
It is performed first the exponential test and if the null hypothesis is not rejected,
it is performed also the chi_test.
@@ -521,8 +529,8 @@ it is performed also the chi_test.
--
-
one_iteration_of_CTPC_algorithm
(var_id: str, tot_vars_count: int) → List¶
+-
+one_iteration_of_CTPC_algorithm(var_id: str, tot_vars_count: int) → List¶
Performs an iteration of the CTPC algorithm using the node var_id
as test_child
.
- Parameters
@@ -537,8 +545,8 @@ it is performed also the chi_test.
PyCTBN.PyCTBN.estimators.structure_estimator module¶
--
-class
PyCTBN.PyCTBN.estimators.structure_estimator.
StructureEstimator
(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, known_edges: List = None)¶
+-
+class PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, known_edges: Optional[List] = None)¶
Bases: object
Has the task of estimating the network structure given the trajectories in samplepath
.
@@ -562,8 +570,8 @@ it is performed also the chi_test.
--
-
adjacency_matrix
() → numpy.ndarray¶
+-
+adjacency_matrix() → numpy.ndarray¶
Converts the estimated structure _complete_graph
to a boolean adjacency matrix representation.
- Returns
@@ -576,8 +584,8 @@ it is performed also the chi_test.
--
-static
build_complete_graph
(node_ids: List) → networkx.classes.digraph.DiGraph¶
+-
+static build_complete_graph(node_ids: List) → networkx.classes.digraph.DiGraph¶
Builds a complete directed graph (no self loops) given the nodes labels in the list node_ids
:
- Parameters
@@ -593,8 +601,8 @@ it is performed also the chi_test.
--
-
build_removable_edges_matrix
(known_edges: List)¶
+-
+build_removable_edges_matrix(known_edges: List)¶
Builds a boolean matrix who shows if a edge could be removed or not, based on prior knowledge given:
- Parameters
@@ -610,8 +618,8 @@ it is performed also the chi_test.
--
-abstract
estimate_structure
() → List¶
+-
+abstract estimate_structure() → List¶
Abstract method to estimate the structure
- Returns
@@ -624,8 +632,8 @@ it is performed also the chi_test.
--
-static
generate_possible_sub_sets_of_size
(u: List, size: int, parent_label: str)¶
+-
+static generate_possible_sub_sets_of_size(u: List, size: int, parent_label: str)¶
Creates a list containing all possible subsets of the list u
of size size
,
that do not contains a the node identified by parent_label
.
@@ -646,9 +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.
+
- Parameters
file_path – path to save the file to
@@ -660,8 +670,8 @@ that do not contains a the node identified by
--
-
save_results
(file_path: str) → None¶
+-
+save_results(file_path: str) → None¶
Save the estimated Structure to a .json file in file_path.
- Parameters
@@ -671,8 +681,8 @@ that do not contains a the node identified by
--
-
spurious_edges
() → List¶
+-
+spurious_edges() → List¶
- Return the spurious edges present in the estimated structure, if a prior net structure is present in
_sample_path.structure
.
@@ -693,8 +703,8 @@ that do not contains a the node identified by
PyCTBN.PyCTBN.estimators.structure_score_based_estimator module¶
--
-class
PyCTBN.PyCTBN.estimators.structure_score_based_estimator.
StructureScoreBasedEstimator
(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, tau_xu: int = 0.1, alpha_xu: int = 1, known_edges: List = [])¶
+-
+class PyCTBN.PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, tau_xu: int = 0.1, alpha_xu: int = 1, known_edges: List = [])¶
Bases: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator
Has the task of estimating the network structure given the trajectories in samplepath by
using a score based approach and differt kinds of optimization algorithms.
@@ -709,8 +719,8 @@ using a score based approach and differt kinds of optimization algorithms.
--
-
estimate_parents
(node_id: str, max_parents: int = None, iterations_number: int = 40, patience: int = 10, tabu_length: int = None, tabu_rules_duration: int = 5, optimizer: str = 'hill')¶
+-
+estimate_parents(node_id: str, max_parents: Optional[int] = None, iterations_number: int = 40, patience: int = 10, tabu_length: Optional[int] = None, tabu_rules_duration: int = 5, optimizer: str = 'hill')¶
Use the FamScore of a node in order to find the best parent nodes
- Parameters
@@ -734,8 +744,10 @@ 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, processes_number: int = None)¶
+
Compute the score-based algorithm to find the optimal structure
- Parameters
@@ -756,8 +768,8 @@ using a score based approach and differt kinds of optimization algorithms.
--
-
get_score_from_graph
(graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph, node_id: str)¶
+-
+get_score_from_graph(graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph, node_id: str)¶
Get the FamScore of a node
- Parameters
@@ -820,6 +832,9 @@ using a score based approach and differt kinds of optimization algorithms.
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.PyCTBN.html b/docs/PyCTBN.PyCTBN.html
index bd6313d..17c42b8 100644
--- a/docs/PyCTBN.PyCTBN.html
+++ b/docs/PyCTBN.PyCTBN.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -142,18 +146,22 @@
- PyCTBN.PyCTBN.structure_graph package
- Submodules
- PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module
+- PyCTBN.PyCTBN.structure_graph.network_generator module
- PyCTBN.PyCTBN.structure_graph.network_graph module
- PyCTBN.PyCTBN.structure_graph.sample_path module
- PyCTBN.PyCTBN.structure_graph.set_of_cims module
- PyCTBN.PyCTBN.structure_graph.structure module
- PyCTBN.PyCTBN.structure_graph.trajectory module
+- PyCTBN.PyCTBN.structure_graph.trajectory_generator module
- Module contents
- PyCTBN.PyCTBN.utility package
- Submodules
+- PyCTBN.PyCTBN.utility.abstract_exporter module
- PyCTBN.PyCTBN.utility.abstract_importer module
- PyCTBN.PyCTBN.utility.cache module
+- PyCTBN.PyCTBN.utility.json_exporter module
- PyCTBN.PyCTBN.utility.json_importer module
- PyCTBN.PyCTBN.utility.sample_importer module
- Module contents
@@ -204,6 +212,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.PyCTBN.optimizers.html b/docs/PyCTBN.PyCTBN.optimizers.html
index 58423f2..94e6d69 100644
--- a/docs/PyCTBN.PyCTBN.optimizers.html
+++ b/docs/PyCTBN.PyCTBN.optimizers.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -123,8 +127,8 @@
PyCTBN.PyCTBN.optimizers.constraint_based_optimizer module¶
--
-class
PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.
ConstraintBasedOptimizer
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, tot_vars_count: int)¶
+-
+class PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, tot_vars_count: int)¶
Bases: PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement a CTPC Algorithm
@@ -137,8 +141,8 @@
--
-
optimize_structure
()¶
+-
+optimize_structure()¶
Compute Optimization process for a structure_estimator by using a CTPC Algorithm
- Returns
@@ -156,8 +160,8 @@
PyCTBN.PyCTBN.optimizers.hill_climbing_search module¶
--
-class
PyCTBN.PyCTBN.optimizers.hill_climbing_search.
HillClimbing
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: int = None, iterations_number: int = 40, patience: int = None)¶
+-
+class PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None)¶
Bases: PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement Hill Climbing Search
@@ -172,8 +176,8 @@
--
-
optimize_structure
() → List¶
+-
+optimize_structure() → List¶
Compute Optimization process for a structure_estimator by using a Hill Climbing Algorithm
- Returns
@@ -191,8 +195,8 @@
PyCTBN.PyCTBN.optimizers.optimizer module¶
--
-class
PyCTBN.PyCTBN.optimizers.optimizer.
Optimizer
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator)¶
+-
+class PyCTBN.PyCTBN.optimizers.optimizer.Optimizer(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator)¶
Bases: abc.ABC
Interface class for all the optimizer’s child PyCTBN
@@ -204,8 +208,8 @@
--
-abstract
optimize_structure
() → List¶
+-
+abstract optimize_structure() → List¶
Compute Optimization process for a structure_estimator
- Returns
@@ -223,8 +227,8 @@
PyCTBN.PyCTBN.optimizers.tabu_search module¶
--
-class
PyCTBN.PyCTBN.optimizers.tabu_search.
TabuSearch
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: int = None, iterations_number: int = 40, patience: int = None, tabu_length: int = None, tabu_rules_duration=None)¶
+-
+class PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None, tabu_length: Optional[int] = None, tabu_rules_duration=None)¶
Bases: PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement Tabu Search
@@ -241,8 +245,8 @@
--
-
optimize_structure
() → List¶
+-
+optimize_structure() → List¶
Compute Optimization process for a structure_estimator by using a Hill Climbing Algorithm
- Returns
@@ -299,6 +303,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.PyCTBN.structure_graph.html b/docs/PyCTBN.PyCTBN.structure_graph.html
index 9ff99e7..6f9561a 100644
--- a/docs/PyCTBN.PyCTBN.structure_graph.html
+++ b/docs/PyCTBN.PyCTBN.structure_graph.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -123,8 +127,8 @@
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module¶
--
-class
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.
ConditionalIntensityMatrix
(state_residence_times: numpy.array, state_transition_matrix: numpy.array)¶
+-
+class PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix(state_residence_times: Optional[numpy.array] = None, state_transition_matrix: Optional[numpy.array] = None, cim: Optional[numpy.array] = None)¶
Bases: object
Abstracts the Conditional Intesity matrix of a node as aggregation of the state residence times vector
and state transition matrix and the actual CIM matrix.
@@ -139,26 +143,103 @@ and state transition matrix and the actual CIM matrix.
the actual cim of the node
-
+
+
+
+PyCTBN.PyCTBN.structure_graph.network_generator module¶
+
+-
+class PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator(labels, vals)¶
+Bases: object
+Provides the methods to generate a network graph and the CIMs related to it
+Items in _labels, _vals and _indxs are related, and therefore respect the same order
+
+- Parameters
+
+_labels (List) – List of variables labels that will be part of the network
+_vals (List) – List of cardinalities of the variables in network (defined in the same order as _labels)
+_indxs (List) – List of the nodes indexes
+_cims (Dict) – It contains, for each variable label (the key), the SetOfCims object related to it
+_graph (NetworkGraph) – The NetworkGraph object representing the generated structure
+
+
+
+
+-
+property cims: dict¶
+
+-
+property dyn_str: list¶
+
+
+
+-
+generate_cims(min_val, max_val)¶
+
+- For each node, generate the corresponding SetOfCims. The objective is to group the CIMs
(actually generated by private method __generate_cim) according to parents possibles states of every node.
+This method must obviously be executed after the graph has been generated.
+
+
+
+- Parameters
+
+min_val (float) – Minimum value allowed for the coefficients in the CIMs
+max_val (float) – Maximum value allowed for the coefficients in the CIMs
+
+
+
+
+
--
-property
state_transition_matrix
¶
+-
+generate_graph(density, fixed: bool = False)¶
+
+- Generate the edges according to specified density, and then instantiate the NetworkGraph object
to represent the network
+
+
+
+- Parameters
+
+density (float) – Probability of an edge between two nodes to exist
+fixed (bool) – Specifies whether the required density is mandatory or it’s just a probability
+
+
+
+
+
+
+-
+property graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph¶
+
+
+
+-
+property variables: list¶
@@ -167,8 +248,8 @@ The class member _c
PyCTBN.PyCTBN.structure_graph.network_graph module¶
--
-class
PyCTBN.PyCTBN.structure_graph.network_graph.
NetworkGraph
(graph_struct: PyCTBN.PyCTBN.structure_graph.structure.Structure)¶
+-
+class PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph(graph_struct: PyCTBN.PyCTBN.structure_graph.structure.Structure)¶
Bases: object
Abstracts the infos contained in the Structure class in the form of a directed graph.
Has the task of creating all the necessary filtering and indexing structures for parameters estimation
@@ -201,8 +282,8 @@ from one state to another
--
-
add_edges
(list_of_edges: List) → None¶
+-
+add_edges(list_of_edges: List) → None¶
Add the edges to the _graph
contained in the list list_of_edges
.
- Parameters
@@ -212,8 +293,8 @@ from one state to another
--
-
add_nodes
(list_of_nodes: List) → None¶
+-
+add_nodes(list_of_nodes: List) → None¶
Adds the nodes to the _graph
contained in the list of nodes list_of_nodes
.
Sets all the properties that identify a nodes (index, positional index, cardinality)
@@ -224,8 +305,8 @@ Sets all the properties that identify a nodes (index, positional index, cardinal
--
-static
build_p_comb_structure_for_a_node
(parents_values: List) → numpy.ndarray¶
+-
+static build_p_comb_structure_for_a_node(parents_values: List) → numpy.ndarray¶
Builds the combinatorial structure that contains the combinations of all the values contained in
parents_values
.
@@ -242,8 +323,8 @@ Sets all the properties that identify a nodes (index, positional index, cardinal
--
-static
build_time_columns_filtering_for_a_node
(node_indx: int, p_indxs: List) → numpy.ndarray¶
+-
+static build_time_columns_filtering_for_a_node(node_indx: int, p_indxs: List) → numpy.ndarray¶
Builds the necessary structure to filter the desired columns indicated by node_indx
and p_indxs
in the dataset.
This structute will be used in the computation of the state res times.
@@ -256,8 +337,8 @@ This structute will be used in the computation of the state res times.
--
-static
build_time_scalar_indexing_structure_for_a_node
(node_states: int, parents_vals: List) → numpy.ndarray¶
+-
+static build_time_scalar_indexing_structure_for_a_node(node_states: int, parents_vals: List) → numpy.ndarray¶
Builds an indexing structure for the computation of state residence times values.
- Parameters
@@ -276,8 +357,8 @@ This structute will be used in the computation of the state res times.
--
-static
build_transition_filtering_for_a_node
(node_indx: int, p_indxs: List, nodes_number: int) → numpy.ndarray¶
+-
+static build_transition_filtering_for_a_node(node_indx: int, p_indxs: List, nodes_number: int) → numpy.ndarray¶
Builds the necessary structure to filter the desired columns indicated by node_indx
and p_indxs
in the dataset.
This structure will be used in the computation of the state transitions values.
@@ -292,8 +373,8 @@ This structure will be used in the computation of the state transitions values.
--
-static
build_transition_scalar_indexing_structure_for_a_node
(node_states_number: int, parents_vals: List) → numpy.ndarray¶
+-
+static build_transition_scalar_indexing_structure_for_a_node(node_states_number: int, parents_vals: List) → numpy.ndarray¶
Builds an indexing structure for the computation of state transitions values.
- Parameters
@@ -312,19 +393,19 @@ This structure will be used in the computation of the state transitions values.
--
-
clear_indexing_filtering_structures
() → None¶
+-
+clear_indexing_filtering_structures() → None¶
Initialize all the filtering/indexing structures.
-
--
-property
edges
¶
+
+-
+property edges: List¶
--
-
fast_init
(node_id: str) → None¶
+-
+fast_init(node_id: str) → None¶
Initializes all the necessary structures for parameters estimation of the node identified by the label
node_id
@@ -335,13 +416,13 @@ node_id
--
-
get_ordered_by_indx_set_of_parents
(node: str) → Tuple¶
+-
+get_ordered_by_indx_set_of_parents(node: str) → Tuple¶
Builds the aggregated structure that holds all the infos relative to the parent set of the node, namely
(parents_labels, parents_indexes, parents_cardinalities).
@@ -358,8 +439,8 @@ node_id
--
-
get_parents_by_id
(node_id) → List¶
+-
+get_parents_by_id(node_id) → List¶
Returns a list of labels of the parents of the node node_id
- Parameters
@@ -375,18 +456,18 @@ node_id
--
-
has_edge
(edge: tuple) → bool¶
+-
+has_edge(edge: tuple) → bool¶
Check if the graph contains a specific edge
- Parameters:
edge: a tuple that rappresents the edge
@@ -396,29 +477,29 @@ node_id
-
--
-property
nodes
¶
+
+-
+property nodes: List¶
-
--
-property
nodes_indexes
¶
+
+-
+property nodes_indexes: numpy.ndarray¶
-
--
-property
nodes_values
¶
+
+-
+property nodes_values: numpy.ndarray¶
-
--
-property
p_combs
¶
+
+-
+property p_combs: numpy.ndarray¶
--
-
remove_edges
(list_of_edges: List) → None¶
+-
+remove_edges(list_of_edges: List) → None¶
Remove the edges to the graph contained in the list list_of_edges.
- Parameters
@@ -428,30 +509,30 @@ node_id
--
-
remove_node
(node_id: str) → None¶
+-
+remove_node(node_id: str) → None¶
Remove the node node_id
from all the class members.
Initialize all the filtering/indexing structures.
-
--
-property
time_filtering
¶
+
+-
+property time_filtering: numpy.ndarray¶
-
--
-property
time_scalar_indexing_strucure
¶
+
+-
+property time_scalar_indexing_strucure: numpy.ndarray¶
-
--
-property
transition_filtering
¶
+
+-
+property transition_filtering: numpy.ndarray¶
-
--
-property
transition_scalar_indexing_structure
¶
+
+-
+property transition_scalar_indexing_structure: numpy.ndarray¶
@@ -460,8 +541,8 @@ Initialize all the filtering/indexing structures.
PyCTBN.PyCTBN.structure_graph.sample_path module¶
--
-class
PyCTBN.PyCTBN.structure_graph.sample_path.
SamplePath
(importer: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter)¶
+-
+class PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath(importer: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter)¶
Bases: object
Aggregates all the informations about the trajectories, the real structure of the sampled net and variables
cardinalites. Has the task of creating the objects Trajectory
and Structure
that will
@@ -481,41 +562,41 @@ contain the mentioned data.
--
-
build_structure
() → None¶
+-
+build_structure() → None¶
Builds the Structure
object that aggregates all the infos about the net.
--
-
build_trajectories
() → None¶
+-
+build_trajectories() → None¶
Builds the Trajectory object that will contain all the trajectories.
Clears all the unused dataframes in _importer
Object
-
--
-property
has_prior_net_structure
¶
+
+-
+property has_prior_net_structure: bool¶
-
--
-property
structure
¶
+
+-
+property structure: PyCTBN.PyCTBN.structure_graph.structure.Structure¶
-
--
-property
total_variables_count
¶
+
+-
+property total_variables_count: int¶
-
--
-property
trajectories
¶
+
+-
+property trajectories: PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory¶
@@ -524,8 +605,8 @@ Clears all the unused dataframes in <
PyCTBN.PyCTBN.structure_graph.set_of_cims module¶
--
-class
PyCTBN.PyCTBN.structure_graph.set_of_cims.
SetOfCims
(node_id: str, parents_states_number: List, node_states_number: int, p_combs: numpy.ndarray)¶
+-
+class PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims(node_id: str, parents_states_number: List, node_states_number: int, p_combs: numpy.ndarray, cims: Optional[numpy.ndarray] = None)¶
Bases: object
Aggregates all the CIMS of the node identified by the label _node_id.
@@ -547,14 +628,14 @@ Clears all the unused dataframes in <
the cims of the node
-
--
-property
actual_cims
¶
+
+-
+property actual_cims: numpy.ndarray¶
--
-
build_cims
(state_res_times: numpy.ndarray, transition_matrices: numpy.ndarray) → None¶
+-
+build_cims(state_res_times: numpy.ndarray, transition_matrices: numpy.ndarray) → None¶
Build the ConditionalIntensityMatrix
objects given the state residence times and transitions matrices.
Compute the cim coefficients.The class member _actual_cims
will contain the computed cims.
@@ -568,14 +649,14 @@ Compute the cim coefficients.The class member
--
-
build_times_and_transitions_structures
() → None¶
+-
+build_times_and_transitions_structures() → None¶
Initializes at the correct dimensions the state residence times matrix and the state transition matrices.
--
-
filter_cims_with_mask
(mask_arr: numpy.ndarray, comb: List) → numpy.ndarray¶
+-
+filter_cims_with_mask(mask_arr: numpy.ndarray, comb: List) → numpy.ndarray¶
Filter the cims contained in the array _actual_cims
given the boolean mask mask_arr
and the index
comb
.
-
@@ -610,8 +691,8 @@ Compute the cim coefficients.The class member
PyCTBN.PyCTBN.structure_graph.structure module¶
--
-class
PyCTBN.PyCTBN.structure_graph.structure.
Structure
(nodes_labels_list: List, nodes_indexes_arr: numpy.ndarray, nodes_vals_arr: numpy.ndarray, edges_list: List, total_variables_number: int)¶
+-
+class PyCTBN.PyCTBN.structure_graph.structure.Structure(nodes_labels_list: List, nodes_indexes_arr: numpy.ndarray, nodes_vals_arr: numpy.ndarray, edges_list: List, total_variables_number: int)¶
Bases: object
Contains all the infos about the network structure(nodes labels, nodes caridinalites, edges, indexes)
@@ -626,28 +707,28 @@ Compute the cim coefficients.The class member
--
-
add_edge
(edge: tuple)¶
+-
+add_edge(edge: tuple)¶
-
--
-property
edges
¶
+
+-
+property edges: List¶
--
-
get_node_id
(node_indx: int) → str¶
+-
+get_node_id(node_indx: int) → str¶
Given the node_index
returns the node label.
- Parameters
@@ -663,8 +744,8 @@ Compute the cim coefficients.The class member
--
-
get_node_indx
(node_id: str) → int¶
+-
+get_node_indx(node_id: str) → int¶
Given the node_index
returns the node label.
- Parameters
@@ -680,13 +761,13 @@ Compute the cim coefficients.The class member
--
-
get_positional_node_indx
(node_id: str) → int¶
+-
+get_positional_node_indx(node_id: str) → int¶
--
-
get_states_number
(node: str) → int¶
+-
+get_states_number(node: str) → int¶
Given the node label node
returns the cardinality of the node.
- Parameters
@@ -701,36 +782,36 @@ Compute the cim coefficients.The class member
--
-property
nodes_indexes
¶
+
+-
+property nodes_indexes: numpy.ndarray¶
-
--
-property
nodes_labels
¶
+
+-
+property nodes_labels: List¶
-
--
-property
nodes_values
¶
+
+-
+property nodes_values: numpy.ndarray¶
-
@@ -739,8 +820,8 @@ The class member _t
PyCTBN.PyCTBN.structure_graph.trajectory module¶
--
-class
PyCTBN.PyCTBN.structure_graph.trajectory.
Trajectory
(list_of_columns: List, original_cols_number: int)¶
+-
+class PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory(list_of_columns: List, original_cols_number: int)¶
Bases: object
Abstracts the infos about a complete set of trajectories, represented as a numpy array of doubles
(the time deltas) and a numpy matrix of ints (the changes of states).
@@ -758,30 +839,32 @@ The class member _t
the array containing the time deltas
-
+
+
Module contents¶
@@ -823,6 +906,9 @@ The class member _t
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.PyCTBN.utility.html b/docs/PyCTBN.PyCTBN.utility.html
index 50c6ce2..05eaa8e 100644
--- a/docs/PyCTBN.PyCTBN.utility.html
+++ b/docs/PyCTBN.PyCTBN.utility.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -119,12 +123,14 @@
PyCTBN.PyCTBN.utility package¶
Submodules¶
+
+
PyCTBN.PyCTBN.utility.abstract_importer module¶
--
-class
PyCTBN.PyCTBN.utility.abstract_importer.
AbstractImporter
(file_path: str = None, trajectory_list: Union[pandas.core.frame.DataFrame, numpy.ndarray] = None, variables: pandas.core.frame.DataFrame = None, prior_net_structure: pandas.core.frame.DataFrame = None)¶
+-
+class PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter(file_path: Optional[str] = None, trajectory_list: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray]] = None, variables: Optional[pandas.core.frame.DataFrame] = None, prior_net_structure: Optional[pandas.core.frame.DataFrame] = None)¶
Bases: abc.ABC
Abstract class that exposes all the necessary methods to process the trajectories and the net structure.
@@ -155,8 +161,8 @@ See the tutorial on how to construct a correct JsonImporter
for an example implementation
--
-
build_list_of_samples_array
(concatenated_sample: pandas.core.frame.DataFrame) → List¶
+-
+build_list_of_samples_array(concatenated_sample: pandas.core.frame.DataFrame) → List¶
Builds a List containing the the delta times numpy array, and the complete transitions matrix
- Parameters
@@ -173,8 +179,8 @@ and converted
--
-abstract
build_sorter
(trajecory_header: object) → List¶
+-
+abstract build_sorter(trajecory_header: object) → List¶
Initializes the _sorter
class member from a trajectory dataframe, exctracting the header of the frame
and keeping ONLY the variables symbolic labels, cutting out the time label in the header.
@@ -191,14 +197,14 @@ and keeping ONLY the variables symbolic labels, cutting out the time label in th
--
-
clear_concatenated_frame
() → None¶
+-
+clear_concatenated_frame() → None¶
Removes all values in the dataframe concatenated_samples.
--
-
compute_row_delta_in_all_samples_frames
(df_samples_list: List) → None¶
+-
+compute_row_delta_in_all_samples_frames(df_samples_list: List) → None¶
Calls the method compute_row_delta_sigle_samples_frame
on every dataframe present in the list
df_samples_list
.
Concatenates the result in the dataframe concatanated_samples
@@ -221,8 +227,8 @@ and merged trajectories
--
-
compute_row_delta_sigle_samples_frame
(sample_frame: pandas.core.frame.DataFrame, columns_header: List, shifted_cols_header: List) → pandas.core.frame.DataFrame¶
+-
+compute_row_delta_sigle_samples_frame(sample_frame: pandas.core.frame.DataFrame, columns_header: List, shifted_cols_header: List) → pandas.core.frame.DataFrame¶
Computes the difference between each value present in th time column.
Copies and shift by one position up all the values present in the remaining columns.
@@ -247,36 +253,36 @@ Header of sample_frame = [Time | Variable values]
-
@@ -285,8 +291,8 @@ dataset
PyCTBN.PyCTBN.utility.cache module¶
--
-class
PyCTBN.PyCTBN.utility.cache.
Cache
¶
+-
+class PyCTBN.PyCTBN.utility.cache.Cache¶
Bases: object
This class acts as a cache of SetOfCims
objects for a node.
@@ -299,14 +305,14 @@ index is related
--
-
find
(parents_comb: Set)¶
+-
+find(parents_comb: Set)¶
Tries to find in cache given the symbolic parents combination parents_comb
the SetOfCims
related to that parents_comb
.
@@ -324,8 +330,8 @@ None otherwise.
--
-
put
(parents_comb: Set, socim: PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims)¶
+-
+put(parents_comb: Set, socim: PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims)¶
Place in cache the SetOfCims
object, and the related symbolic index parents_comb
in
__list_of_sets_of_parents
.
@@ -340,12 +346,14 @@ None otherwise.
+
+
PyCTBN.PyCTBN.utility.json_importer module¶
--
-class
PyCTBN.PyCTBN.utility.json_importer.
JsonImporter
(file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str, variables_key: str)¶
+-
+class PyCTBN.PyCTBN.utility.json_importer.JsonImporter(file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str, variables_key: str, cims_label: Optional[str] = None)¶
Bases: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter
Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare
the data in json extension.
@@ -371,27 +379,29 @@ the data in json extension.
--
-
build_sorter
(sample_frame: pandas.core.frame.DataFrame) → List¶
+-
+build_sorter(sample_frame: pandas.core.frame.DataFrame) → List¶
Implements the abstract method build_sorter of the AbstractImporter
for this dataset.
--
-
clear_data_frame_list
() → None¶
+-
+clear_data_frame_list() → None¶
Removes all values present in the dataframes in the list _df_samples_list
.
--
-
dataset_id
() → object¶
+-
+dataset_id() → object¶
If the original dataset contains multiple dataset, this method returns a unique id to identify the current
dataset
+
-
import_data
(indx: int = 0) → None¶
+
Implements the abstract method of AbstractImporter
.
- Parameters
@@ -401,8 +411,8 @@ dataset
--
-
import_sampled_cims
(raw_data: List, indx: int, cims_key: str) → Dict¶
+-
+import_sampled_cims(raw_data: List, indx: int, cims_key: str) → Dict¶
Imports the synthetic CIMS in the dataset in a dictionary, using variables labels
as keys for the set of CIMS of a particular node.
@@ -423,8 +433,8 @@ as keys for the set of CIMS of a particular node.
--
-
import_structure
(raw_data: List) → pandas.core.frame.DataFrame¶
+-
+import_structure(raw_data: List) → pandas.core.frame.DataFrame¶
Imports in a dataframe the data in the list raw_data at the key _structure_label
- Parameters
@@ -440,8 +450,8 @@ as keys for the set of CIMS of a particular node.
--
-
import_trajectories
(raw_data: List) → List¶
+-
+import_trajectories(raw_data: List) → List¶
Imports the trajectories from the list of dicts raw_data
.
- Parameters
@@ -457,8 +467,8 @@ as keys for the set of CIMS of a particular node.
--
-
import_variables
(raw_data: List) → pandas.core.frame.DataFrame¶
+-
+import_variables(raw_data: List) → pandas.core.frame.DataFrame¶
Imports the data in raw_data
at the key _variables_label
.
- Parameters
@@ -474,8 +484,8 @@ as keys for the set of CIMS of a particular node.
--
-
normalize_trajectories
(raw_data: List, indx: int, trajectories_key: str) → List¶
+-
+normalize_trajectories(raw_data: List, indx: int, trajectories_key: str) → List¶
Extracts the trajectories in raw_data
at the index index
at the key trajectories key
.
- Parameters
@@ -495,8 +505,8 @@ as keys for the set of CIMS of a particular node.
--
-
one_level_normalizing
(raw_data: List, indx: int, key: str) → pandas.core.frame.DataFrame¶
+-
+one_level_normalizing(raw_data: List, indx: int, key: str) → pandas.core.frame.DataFrame¶
Extracts the one-level nested data in the list raw_data
at the index indx
at the key key
.
- Parameters
@@ -516,8 +526,8 @@ as keys for the set of CIMS of a particular node.
--
-
read_json_file
() → List¶
+-
+read_json_file() → List¶
Reads the JSON file in the path self.filePath.
- Returns
@@ -535,8 +545,8 @@ as keys for the set of CIMS of a particular node.
PyCTBN.PyCTBN.utility.sample_importer module¶
--
-class
PyCTBN.PyCTBN.utility.sample_importer.
SampleImporter
(trajectory_list: Union[pandas.core.frame.DataFrame, numpy.ndarray, List] = None, variables: Union[pandas.core.frame.DataFrame, numpy.ndarray, List] = None, prior_net_structure: Union[pandas.core.frame.DataFrame, numpy.ndarray, List] = None)¶
+-
+class PyCTBN.PyCTBN.utility.sample_importer.SampleImporter(trajectory_list: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, List]] = None, variables: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, List]] = None, prior_net_structure: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, List]] = None)¶
Bases: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter
Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare
the data loaded directly by using DataFrame
@@ -556,21 +566,21 @@ the data loaded directly by using DataFrame
--
-
build_sorter
(sample_frame: pandas.core.frame.DataFrame) → List¶
+-
+build_sorter(sample_frame: pandas.core.frame.DataFrame) → List¶
Implements the abstract method build_sorter of the AbstractImporter
in order to get the ordered variables list.
@@ -618,6 +628,9 @@ dataset
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.html b/docs/PyCTBN.html
index 8f6f17f..a6024f3 100644
--- a/docs/PyCTBN.html
+++ b/docs/PyCTBN.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -142,18 +146,22 @@
- PyCTBN.PyCTBN.structure_graph package
- Submodules
- PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module
+- PyCTBN.PyCTBN.structure_graph.network_generator module
- PyCTBN.PyCTBN.structure_graph.network_graph module
- PyCTBN.PyCTBN.structure_graph.sample_path module
- PyCTBN.PyCTBN.structure_graph.set_of_cims module
- PyCTBN.PyCTBN.structure_graph.structure module
- PyCTBN.PyCTBN.structure_graph.trajectory module
+- PyCTBN.PyCTBN.structure_graph.trajectory_generator module
- Module contents
- PyCTBN.PyCTBN.utility package
- Submodules
+- PyCTBN.PyCTBN.utility.abstract_exporter module
- PyCTBN.PyCTBN.utility.abstract_importer module
- PyCTBN.PyCTBN.utility.cache module
+- PyCTBN.PyCTBN.utility.json_exporter module
- PyCTBN.PyCTBN.utility.json_importer module
- PyCTBN.PyCTBN.utility.sample_importer module
- Module contents
@@ -164,13 +172,59 @@
- Module contents
+- PyCTBN.tests package
+- Subpackages
+- PyCTBN.tests.estimators package
+
+- PyCTBN.tests.optimizers package
+
+- PyCTBN.tests.structure_graph package
+- Submodules
+- PyCTBN.tests.structure_graph.test_cim module
+- PyCTBN.tests.structure_graph.test_networkgenerator module
+- PyCTBN.tests.structure_graph.test_networkgraph module
+- PyCTBN.tests.structure_graph.test_sample_path module
+- PyCTBN.tests.structure_graph.test_setofcims module
+- PyCTBN.tests.structure_graph.test_structure module
+- PyCTBN.tests.structure_graph.test_trajectory module
+- PyCTBN.tests.structure_graph.test_trajectorygenerator module
+- Module contents
+
+
+- PyCTBN.tests.utility package
+
+
+
+- Module contents
+
+
Submodules¶
+
+
Module contents¶
@@ -203,6 +257,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.tests.estimators.html b/docs/PyCTBN.tests.estimators.html
index 8a63d1f..c39f871 100644
--- a/docs/PyCTBN.tests.estimators.html
+++ b/docs/PyCTBN.tests.estimators.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -120,42 +124,43 @@
PyCTBN.tests.estimators.test_parameters_estimator module¶
--
-class
PyCTBN.tests.estimators.test_parameters_estimator.
TestParametersEstimatior
(methodName='runTest')¶
+-
+class PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-
aux_import_sampled_cims
(cims_label)¶
+-
+aux_import_sampled_cims(cims_label)¶
--
-
cim_equality_test
(cim1, cim2)¶
+-
+cim_equality_test(cim1, cim2)¶
--
-
equality_of_cims_of_node
(sampled_cims, estimated_cims)¶
+-
+equality_of_cims_of_node(sampled_cims, estimated_cims)¶
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_compute_parameters_for_node
()¶
+-
+test_compute_parameters_for_node()¶
--
-
test_fast_init
()¶
+-
+test_fast_init()¶
+
PyCTBN.tests.estimators.test_structure_constraint_based_estimator module¶
@@ -188,59 +193,61 @@
+
PyCTBN.tests.estimators.test_structure_estimator module¶
--
-class
PyCTBN.tests.estimators.test_structure_estimator.
TestStructureEstimator
(methodName='runTest')¶
+-
+class PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod
setUpClass
()¶
+-
+classmethod setUpClass()¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_adjacency_matrix
()¶
+-
+test_adjacency_matrix()¶
--
-
test_build_complete_graph
()¶
+-
+test_build_complete_graph()¶
--
-
test_build_removable_edges_matrix
()¶
+-
+test_build_removable_edges_matrix()¶
--
-
test_generate_possible_sub_sets_of_size
()¶
+-
+test_generate_possible_sub_sets_of_size()¶
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_save_plot_estimated_graph
()¶
+-
+test_save_plot_estimated_graph()¶
--
-
test_save_results
()¶
+-
+test_save_results()¶
--
-
test_time
()¶
+-
+test_time()¶
+
PyCTBN.tests.estimators.test_structure_score_based_estimator module¶
@@ -310,6 +317,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.tests.html b/docs/PyCTBN.tests.html
index 83be260..57c3a3d 100644
--- a/docs/PyCTBN.tests.html
+++ b/docs/PyCTBN.tests.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -121,27 +125,29 @@
- PyCTBN.tests.estimators package
- Submodules
- PyCTBN.tests.estimators.test_parameters_estimator module
-- PyCTBN.tests.estimators.test_structure_constraint_based_estimator module
+- PyCTBN.tests.estimators.test_structure_constraint_based_estimator module
- PyCTBN.tests.estimators.test_structure_estimator module
-- PyCTBN.tests.estimators.test_structure_score_based_estimator module
+- PyCTBN.tests.estimators.test_structure_score_based_estimator module
- Module contents
- PyCTBN.tests.optimizers package
- PyCTBN.tests.structure_graph package
- Submodules
- PyCTBN.tests.structure_graph.test_cim module
+- PyCTBN.tests.structure_graph.test_networkgenerator module
- PyCTBN.tests.structure_graph.test_networkgraph module
- PyCTBN.tests.structure_graph.test_sample_path module
- PyCTBN.tests.structure_graph.test_setofcims module
- PyCTBN.tests.structure_graph.test_structure module
- PyCTBN.tests.structure_graph.test_trajectory module
+- PyCTBN.tests.structure_graph.test_trajectorygenerator module
- Module contents
@@ -189,6 +195,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.tests.optimizers.html b/docs/PyCTBN.tests.optimizers.html
index 96038cc..2e20c9a 100644
--- a/docs/PyCTBN.tests.optimizers.html
+++ b/docs/PyCTBN.tests.optimizers.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -200,6 +204,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.tests.structure_graph.html b/docs/PyCTBN.tests.structure_graph.html
index f3dae53..581cd0c 100644
--- a/docs/PyCTBN.tests.structure_graph.html
+++ b/docs/PyCTBN.tests.structure_graph.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -120,28 +124,28 @@
PyCTBN.tests.structure_graph.test_cim module¶
--
-class
PyCTBN.tests.structure_graph.test_cim.
TestConditionalIntensityMatrix
(methodName='runTest')¶
+-
+class PyCTBN.tests.structure_graph.test_cim.TestConditionalIntensityMatrix(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_compute_cim_coefficients
()¶
+-
+test_compute_cim_coefficients()¶
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_repr
()¶
+-
+test_repr()¶
@@ -150,103 +154,103 @@
PyCTBN.tests.structure_graph.test_networkgraph module¶
--
-class
PyCTBN.tests.structure_graph.test_networkgraph.
TestNetworkGraph
(methodName='runTest')¶
+-
+class PyCTBN.tests.structure_graph.test_networkgraph.TestNetworkGraph(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-
aux_build_p_combs_structure
(graph, p_vals)¶
+-
+aux_build_p_combs_structure(graph, p_vals)¶
--
-
aux_build_time_columns_filtering_structure_for_a_node
(graph, node_id, p_indxs)¶
+-
+aux_build_time_columns_filtering_structure_for_a_node(graph, node_id, p_indxs)¶
--
-
aux_build_time_scalar_indexing_structure_for_a_node
(graph, node_id, parents_indxs, parents_labels, parents_vals)¶
+-
+aux_build_time_scalar_indexing_structure_for_a_node(graph, node_id, parents_indxs, parents_labels, parents_vals)¶
--
-
aux_build_transition_columns_filtering_structure
(graph, node_id, p_indxs)¶
+-
+aux_build_transition_columns_filtering_structure(graph, node_id, p_indxs)¶
--
-
aux_build_transition_scalar_indexing_structure_for_a_node
(graph, node_id, parents_indxs, parents_labels, parents_values)¶
+-
+aux_build_transition_scalar_indexing_structure_for_a_node(graph, node_id, parents_indxs, parents_labels, parents_values)¶
--
-classmethod
setUpClass
()¶
+-
+classmethod setUpClass()¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_add_edges
()¶
+-
+test_add_edges()¶
--
-
test_add_nodes
()¶
+-
+test_add_nodes()¶
--
-
test_build_p_combs_structure
()¶
+-
+test_build_p_combs_structure()¶
--
-
test_build_time_columns_filtering_structure_for_a_node
()¶
+-
+test_build_time_columns_filtering_structure_for_a_node()¶
--
-
test_build_time_scalar_indexing_structure_for_a_node
()¶
+-
+test_build_time_scalar_indexing_structure_for_a_node()¶
--
-
test_build_transition_columns_filtering_structure
()¶
+-
+test_build_transition_columns_filtering_structure()¶
--
-
test_build_transition_scalar_indexing_structure_for_a_node
()¶
+-
+test_build_transition_scalar_indexing_structure_for_a_node()¶
--
-
test_fast_init
()¶
+-
+test_fast_init()¶
--
-
test_get_node_indx
()¶
+-
+test_get_node_indx()¶
--
-
test_get_ordered_by_indx_set_of_parents
()¶
+-
+test_get_ordered_by_indx_set_of_parents()¶
--
-
test_get_parents_by_id
()¶
+-
+test_get_parents_by_id()¶
--
-
test_get_states_number
()¶
+-
+test_get_states_number()¶
--
-
test_init
()¶
+-
+test_init()¶
@@ -255,58 +259,58 @@
PyCTBN.tests.structure_graph.test_sample_path module¶
--
-class
PyCTBN.tests.structure_graph.test_sample_path.
TestSamplePath
(methodName='runTest')¶
+-
+class PyCTBN.tests.structure_graph.test_sample_path.TestSamplePath(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_buid_samplepath_no_concatenated_samples
()¶
+-
+test_buid_samplepath_no_concatenated_samples()¶
--
-
test_buid_samplepath_no_variables
()¶
+-
+test_buid_samplepath_no_variables()¶
--
-
test_build_saplepath_no_prior_net_structure
()¶
+-
+test_build_saplepath_no_prior_net_structure()¶
--
-
test_build_structure
()¶
+-
+test_build_structure()¶
--
-
test_build_structure_bad_sorter
()¶
+-
+test_build_structure_bad_sorter()¶
--
-
test_build_trajectories
()¶
+-
+test_build_trajectories()¶
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_init_not_filled_dataframse
()¶
+-
+test_init_not_filled_dataframse()¶
--
-
test_init_not_initialized_importer
()¶
+-
+test_init_not_initialized_importer()¶
@@ -315,27 +319,27 @@
PyCTBN.tests.structure_graph.test_setofcims module¶
--
-class
PyCTBN.tests.structure_graph.test_setofcims.
TestSetOfCims
(methodName='runTest')¶
+-
+class PyCTBN.tests.structure_graph.test_setofcims.TestSetOfCims(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-
another_filtering_method
(p_combs, mask, parent_value)¶
+-
+another_filtering_method(p_combs, mask, parent_value)¶
--
-
aux_test_build_cims
(node_id, p_values, node_states, p_combs)¶
+-
+aux_test_build_cims(node_id, p_values, node_states, p_combs)¶
--
-
aux_test_init
(node_id, parents_states_number, node_states_number, p_combs)¶
+-
+aux_test_init(node_id, parents_states_number, node_states_number, p_combs)¶
--
-
build_p_comb_structure_for_a_node
(parents_values)¶
+-
+build_p_comb_structure_for_a_node(parents_values)¶
Builds the combinatory structure that contains the combinations of all the values contained in parents_values.
- Parameters:
parents_values: the cardinalities of the nodes
@@ -346,24 +350,24 @@
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_build_cims
()¶
+-
+test_build_cims()¶
--
-
test_filter_cims_with_mask
()¶
+-
+test_filter_cims_with_mask()¶
--
-
test_init
()¶
+-
+test_init()¶
@@ -372,53 +376,53 @@
PyCTBN.tests.structure_graph.test_structure module¶
--
-class
PyCTBN.tests.structure_graph.test_structure.
TestStructure
(methodName='runTest')¶
+-
+class PyCTBN.tests.structure_graph.test_structure.TestStructure(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod
setUpClass
()¶
+-
+classmethod setUpClass()¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_edges_operations
()¶
+-
+test_edges_operations()¶
--
-
test_equality
()¶
+-
+test_equality()¶
--
-
test_get_node_id
()¶
+-
+test_get_node_id()¶
--
-
test_get_node_indx
()¶
+-
+test_get_node_indx()¶
--
-
test_get_positional_node_indx
()¶
+-
+test_get_positional_node_indx()¶
--
-
test_get_states_number
()¶
+-
+test_get_states_number()¶
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_repr
()¶
+-
+test_repr()¶
@@ -427,22 +431,23 @@
PyCTBN.tests.structure_graph.test_trajectory module¶
--
-class
PyCTBN.tests.structure_graph.test_trajectory.
TestTrajectory
(methodName='runTest')¶
+-
+class PyCTBN.tests.structure_graph.test_trajectory.TestTrajectory(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_init
()¶
+-
+test_init()¶
+
Module contents¶
@@ -477,6 +482,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/PyCTBN.tests.utility.html b/docs/PyCTBN.tests.utility.html
index 606ce71..6e10516 100644
--- a/docs/PyCTBN.tests.utility.html
+++ b/docs/PyCTBN.tests.utility.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -120,27 +124,27 @@
PyCTBN.tests.utility.test_cache module¶
--
-class
PyCTBN.tests.utility.test_cache.
TestCache
(methodName='runTest')¶
+-
+class PyCTBN.tests.utility.test_cache.TestCache(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-
test_clear
()¶
+-
+test_clear()¶
--
-
test_find
()¶
+-
+test_find()¶
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_put
()¶
+-
+test_put()¶
@@ -149,108 +153,108 @@
PyCTBN.tests.utility.test_json_importer module¶
--
-class
PyCTBN.tests.utility.test_json_importer.
TestJsonImporter
(methodName='runTest')¶
+-
+class PyCTBN.tests.utility.test_json_importer.TestJsonImporter(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-
ordered
(obj)¶
+-
+ordered(obj)¶
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_build_sorter
()¶
+-
+test_build_sorter()¶
--
-
test_clear_concatenated_frame
()¶
+-
+test_clear_concatenated_frame()¶
--
-
test_clear_data_frame_list
()¶
+-
+test_clear_data_frame_list()¶
--
-
test_compute_row_delta_in_all_frames
()¶
+-
+test_compute_row_delta_in_all_frames()¶
--
-
test_compute_row_delta_in_all_frames_not_init_sorter
()¶
+-
+test_compute_row_delta_in_all_frames_not_init_sorter()¶
--
-
test_compute_row_delta_single_samples_frame
()¶
+-
+test_compute_row_delta_single_samples_frame()¶
--
-
test_dataset_id
()¶
+-
+test_dataset_id()¶
--
-
test_file_path
()¶
+-
+test_file_path()¶
--
-
test_import_data
()¶
+-
+test_import_data()¶
--
-
test_import_sampled_cims
()¶
+-
+test_import_sampled_cims()¶
--
-
test_import_structure
()¶
+-
+test_import_structure()¶
--
-
test_import_variables
()¶
+-
+test_import_variables()¶
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_normalize_trajectories
()¶
+-
+test_normalize_trajectories()¶
--
-
test_normalize_trajectories_wrong_indx
()¶
+-
+test_normalize_trajectories_wrong_indx()¶
--
-
test_normalize_trajectories_wrong_key
()¶
+-
+test_normalize_trajectories_wrong_key()¶
--
-
test_read_json_file_found
()¶
+-
+test_read_json_file_found()¶
--
-
test_read_json_file_not_found
()¶
+-
+test_read_json_file_not_found()¶
@@ -259,28 +263,28 @@
PyCTBN.tests.utility.test_sample_importer module¶
--
-class
PyCTBN.tests.utility.test_sample_importer.
TestSampleImporter
(methodName='runTest')¶
+-
+class PyCTBN.tests.utility.test_sample_importer.TestSampleImporter(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-
ordered
(obj)¶
+-
+ordered(obj)¶
--
-classmethod
setUpClass
() → None¶
+-
+classmethod setUpClass() → None¶
Hook method for setting up class fixture before running tests in the class.
--
-
test_init
()¶
+-
+test_init()¶
--
-
test_order
()¶
+-
+test_order()¶
@@ -319,6 +323,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/_sources/PyCTBN.PyCTBN.structure_graph.rst.txt b/docs/_sources/PyCTBN.PyCTBN.structure_graph.rst.txt
index c236017..f00477b 100644
--- a/docs/_sources/PyCTBN.PyCTBN.structure_graph.rst.txt
+++ b/docs/_sources/PyCTBN.PyCTBN.structure_graph.rst.txt
@@ -12,6 +12,14 @@ PyCTBN.PyCTBN.structure\_graph.conditional\_intensity\_matrix module
:undoc-members:
:show-inheritance:
+PyCTBN.PyCTBN.structure\_graph.network\_generator module
+--------------------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.structure_graph.network_generator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.PyCTBN.structure\_graph.network\_graph module
----------------------------------------------------
@@ -52,6 +60,14 @@ PyCTBN.PyCTBN.structure\_graph.trajectory module
:undoc-members:
:show-inheritance:
+PyCTBN.PyCTBN.structure\_graph.trajectory\_generator module
+-----------------------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.structure_graph.trajectory_generator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
Module contents
---------------
diff --git a/docs/_sources/PyCTBN.PyCTBN.utility.rst.txt b/docs/_sources/PyCTBN.PyCTBN.utility.rst.txt
index 1a8a33d..d804edf 100644
--- a/docs/_sources/PyCTBN.PyCTBN.utility.rst.txt
+++ b/docs/_sources/PyCTBN.PyCTBN.utility.rst.txt
@@ -4,6 +4,14 @@ PyCTBN.PyCTBN.utility package
Submodules
----------
+PyCTBN.PyCTBN.utility.abstract\_exporter module
+-----------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.utility.abstract_exporter
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.PyCTBN.utility.abstract\_importer module
-----------------------------------------------
@@ -20,6 +28,14 @@ PyCTBN.PyCTBN.utility.cache module
:undoc-members:
:show-inheritance:
+PyCTBN.PyCTBN.utility.json\_exporter module
+-------------------------------------------
+
+.. automodule:: PyCTBN.PyCTBN.utility.json_exporter
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.PyCTBN.utility.json\_importer module
-------------------------------------------
diff --git a/docs/_sources/PyCTBN.rst.txt b/docs/_sources/PyCTBN.rst.txt
index db94109..3aaa3ce 100644
--- a/docs/_sources/PyCTBN.rst.txt
+++ b/docs/_sources/PyCTBN.rst.txt
@@ -8,10 +8,27 @@ Subpackages
:maxdepth: 4
PyCTBN.PyCTBN
+ PyCTBN.tests
Submodules
----------
+PyCTBN.basic\_main module
+-------------------------
+
+.. automodule:: PyCTBN.basic_main
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+PyCTBN.setup module
+-------------------
+
+.. automodule:: PyCTBN.setup
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
Module contents
---------------
diff --git a/docs/_sources/PyCTBN.tests.structure_graph.rst.txt b/docs/_sources/PyCTBN.tests.structure_graph.rst.txt
index 257d48d..7240498 100644
--- a/docs/_sources/PyCTBN.tests.structure_graph.rst.txt
+++ b/docs/_sources/PyCTBN.tests.structure_graph.rst.txt
@@ -12,6 +12,14 @@ PyCTBN.tests.structure\_graph.test\_cim module
:undoc-members:
:show-inheritance:
+PyCTBN.tests.structure\_graph.test\_networkgenerator module
+-----------------------------------------------------------
+
+.. automodule:: PyCTBN.tests.structure_graph.test_networkgenerator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
PyCTBN.tests.structure\_graph.test\_networkgraph module
-------------------------------------------------------
@@ -52,6 +60,14 @@ PyCTBN.tests.structure\_graph.test\_trajectory module
:undoc-members:
:show-inheritance:
+PyCTBN.tests.structure\_graph.test\_trajectorygenerator module
+--------------------------------------------------------------
+
+.. automodule:: PyCTBN.tests.structure_graph.test_trajectorygenerator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
Module contents
---------------
diff --git a/docs/_sources/example.rst.txt b/docs/_sources/example.rst.txt
new file mode 100644
index 0000000..7789de1
--- /dev/null
+++ b/docs/_sources/example.rst.txt
@@ -0,0 +1,7 @@
+example module
+==============
+
+.. automodule:: example
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/_sources/modules.rst.txt b/docs/_sources/modules.rst.txt
index 4ec310b..aa7e7d5 100644
--- a/docs/_sources/modules.rst.txt
+++ b/docs/_sources/modules.rst.txt
@@ -4,5 +4,6 @@ PyCTBN
.. toctree::
:maxdepth: 4
- PyCTBN.PyCTBN
- examples
+ PyCTBN
+ example
+ setup
diff --git a/docs/_static/basic.css b/docs/_static/basic.css
index 24a49f0..aa9df31 100644
--- a/docs/_static/basic.css
+++ b/docs/_static/basic.css
@@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
- * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -130,7 +130,7 @@ ul.search li a {
font-weight: bold;
}
-ul.search li div.context {
+ul.search li p.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
@@ -277,25 +277,25 @@ p.rubric {
font-weight: bold;
}
-img.align-left, .figure.align-left, object.align-left {
+img.align-left, figure.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
-img.align-right, .figure.align-right, object.align-right {
+img.align-right, figure.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
-img.align-center, .figure.align-center, object.align-center {
+img.align-center, figure.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
-img.align-default, .figure.align-default {
+img.align-default, figure.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
@@ -319,7 +319,8 @@ img.align-default, .figure.align-default {
/* -- sidebars -------------------------------------------------------------- */
-div.sidebar {
+div.sidebar,
+aside.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px;
@@ -377,12 +378,14 @@ div.body p.centered {
/* -- content of sidebars/topics/admonitions -------------------------------- */
div.sidebar > :last-child,
+aside.sidebar > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}
div.sidebar::after,
+aside.sidebar::after,
div.topic::after,
div.admonition::after,
blockquote::after {
@@ -455,20 +458,22 @@ td > :last-child {
/* -- figures --------------------------------------------------------------- */
-div.figure {
+div.figure, figure {
margin: 0.5em;
padding: 0.5em;
}
-div.figure p.caption {
+div.figure p.caption, figcaption {
padding: 0.3em;
}
-div.figure p.caption span.caption-number {
+div.figure p.caption span.caption-number,
+figcaption span.caption-number {
font-style: italic;
}
-div.figure p.caption span.caption-text {
+div.figure p.caption span.caption-text,
+figcaption span.caption-text {
}
/* -- field list styles ----------------------------------------------------- */
@@ -503,6 +508,63 @@ table.hlist td {
vertical-align: top;
}
+/* -- object description styles --------------------------------------------- */
+
+.sig {
+ font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
+}
+
+.sig-name, code.descname {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+.sig-name {
+ font-size: 1.1em;
+}
+
+code.descname {
+ font-size: 1.2em;
+}
+
+.sig-prename, code.descclassname {
+ background-color: transparent;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.sig-paren {
+ font-size: larger;
+}
+
+.sig-param.n {
+ font-style: italic;
+}
+
+/* C++ specific styling */
+
+.sig-inline.c-texpr,
+.sig-inline.cpp-texpr {
+ font-family: unset;
+}
+
+.sig.c .k, .sig.c .kt,
+.sig.cpp .k, .sig.cpp .kt {
+ color: #0033B3;
+}
+
+.sig.c .m,
+.sig.cpp .m {
+ color: #1750EB;
+}
+
+.sig.c .s, .sig.c .sc,
+.sig.cpp .s, .sig.cpp .sc {
+ color: #067D17;
+}
+
/* -- other body styles ----------------------------------------------------- */
@@ -629,14 +691,6 @@ dl.glossary dt {
font-size: 1.1em;
}
-.optional {
- font-size: 1.3em;
-}
-
-.sig-paren {
- font-size: larger;
-}
-
.versionmodified {
font-style: italic;
}
@@ -766,7 +820,11 @@ div.code-block-caption code {
table.highlighttable td.linenos,
span.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
- user-select: none;
+ user-select: none;
+ -webkit-user-select: text; /* Safari fallback only */
+ -webkit-user-select: none; /* Chrome/Safari */
+ -moz-user-select: none; /* Firefox */
+ -ms-user-select: none; /* IE10+ */
}
div.code-block-caption span.caption-number {
@@ -781,16 +839,6 @@ div.literal-block-wrapper {
margin: 1em 0;
}
-code.descname {
- background-color: transparent;
- font-weight: bold;
- font-size: 1.2em;
-}
-
-code.descclassname {
- background-color: transparent;
-}
-
code.xref, a code {
background-color: transparent;
font-weight: bold;
diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js
index 7d88f80..61ac9d2 100644
--- a/docs/_static/doctools.js
+++ b/docs/_static/doctools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
- * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -29,9 +29,14 @@ if (!window.console || !console.firebug) {
/**
* small helper function to urldecode strings
+ *
+ * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
- return decodeURIComponent(x).replace(/\+/g, ' ');
+ if (!x) {
+ return x
+ }
+ return decodeURIComponent(x.replace(/\+/g, ' '));
};
/**
diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js
index d2b4ee9..863704b 100644
--- a/docs/_static/language_data.js
+++ b/docs/_static/language_data.js
@@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
- * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -13,7 +13,8 @@
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
-/* Non-minified version JS is _stemmer.js if file is provided */
+/* Non-minified version is copied as a separate JS file, is available */
+
/**
* Porter Stemmer
*/
@@ -199,7 +200,6 @@ var Stemmer = function() {
-
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css
index 348ec44..28eb679 100644
--- a/docs/_static/pygments.css
+++ b/docs/_static/pygments.css
@@ -1,7 +1,7 @@
-pre { line-height: 125%; }
-td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
-span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
-td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
-span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+pre { line-height: 125%; margin: 0; }
+td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
+span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
\ No newline at end of file
diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js
index 261ecaa..e09f926 100644
--- a/docs/_static/searchtools.js
+++ b/docs/_static/searchtools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
- * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -248,7 +248,7 @@ var Search = {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
- var listItem = $('');
+ var listItem = $('');
var requestUrl = "";
var linkUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
@@ -273,9 +273,9 @@ var Search = {
if (item[3]) {
listItem.append($(' (' + item[3] + ')'));
Search.output.append(listItem);
- listItem.slideDown(5, function() {
+ setTimeout(function() {
displayNextItem();
- });
+ }, 5);
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: requestUrl,
dataType: "text",
@@ -285,16 +285,16 @@ var Search = {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
}
Search.output.append(listItem);
- listItem.slideDown(5, function() {
+ setTimeout(function() {
displayNextItem();
- });
+ }, 5);
}});
} else {
// no source available, just display title
Search.output.append(listItem);
- listItem.slideDown(5, function() {
+ setTimeout(function() {
displayNextItem();
- });
+ }, 5);
}
}
// search finished, update title and status message
@@ -379,6 +379,13 @@ var Search = {
return results;
},
+ /**
+ * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
+ */
+ escapeRegExp : function(string) {
+ return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
+ },
+
/**
* search for full-text terms in the index
*/
@@ -402,13 +409,14 @@ var Search = {
];
// add support for partial matches
if (word.length > 2) {
+ var word_regex = this.escapeRegExp(word);
for (var w in terms) {
- if (w.match(word) && !terms[word]) {
+ if (w.match(word_regex) && !terms[word]) {
_o.push({files: terms[w], score: Scorer.partialTerm})
}
}
for (var w in titleterms) {
- if (w.match(word) && !titleterms[word]) {
+ if (w.match(word_regex) && !titleterms[word]) {
_o.push({files: titleterms[w], score: Scorer.partialTitle})
}
}
@@ -501,7 +509,7 @@ var Search = {
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
- var rv = $('').text(excerpt);
+ var rv = $('').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
diff --git a/docs/_static/underscore-1.13.1.js b/docs/_static/underscore-1.13.1.js
new file mode 100644
index 0000000..ffd77af
--- /dev/null
+++ b/docs/_static/underscore-1.13.1.js
@@ -0,0 +1,2042 @@
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define('underscore', factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
+ var current = global._;
+ var exports = global._ = factory();
+ exports.noConflict = function () { global._ = current; return exports; };
+ }()));
+}(this, (function () {
+ // Underscore.js 1.13.1
+ // https://underscorejs.org
+ // (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
+ // Underscore may be freely distributed under the MIT license.
+
+ // Current version.
+ var VERSION = '1.13.1';
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self == 'object' && self.self === self && self ||
+ typeof global == 'object' && global.global === global && global ||
+ Function('return this')() ||
+ {};
+
+ // Save bytes in the minified (but not gzipped) version:
+ var ArrayProto = Array.prototype, ObjProto = Object.prototype;
+ var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
+
+ // Create quick reference variables for speed access to core prototypes.
+ var push = ArrayProto.push,
+ slice = ArrayProto.slice,
+ toString = ObjProto.toString,
+ hasOwnProperty = ObjProto.hasOwnProperty;
+
+ // Modern feature detection.
+ var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
+ supportsDataView = typeof DataView !== 'undefined';
+
+ // All **ECMAScript 5+** native function implementations that we hope to use
+ // are declared here.
+ var nativeIsArray = Array.isArray,
+ nativeKeys = Object.keys,
+ nativeCreate = Object.create,
+ nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
+
+ // Create references to these builtin functions because we override them.
+ var _isNaN = isNaN,
+ _isFinite = isFinite;
+
+ // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
+ var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
+ var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
+ 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
+
+ // The largest integer that can be represented exactly.
+ var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
+
+ // Some functions take a variable number of arguments, or a few expected
+ // arguments at the beginning and then a variable number of values to operate
+ // on. This helper accumulates all remaining arguments past the function’s
+ // argument length (or an explicit `startIndex`), into an array that becomes
+ // the last argument. Similar to ES6’s "rest parameter".
+ function restArguments(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0),
+ rest = Array(length),
+ index = 0;
+ for (; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ case 2: return func.call(this, arguments[0], arguments[1], rest);
+ }
+ var args = Array(startIndex + 1);
+ for (index = 0; index < startIndex; index++) {
+ args[index] = arguments[index];
+ }
+ args[startIndex] = rest;
+ return func.apply(this, args);
+ };
+ }
+
+ // Is a given variable an object?
+ function isObject(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ }
+
+ // Is a given value equal to null?
+ function isNull(obj) {
+ return obj === null;
+ }
+
+ // Is a given variable undefined?
+ function isUndefined(obj) {
+ return obj === void 0;
+ }
+
+ // Is a given value a boolean?
+ function isBoolean(obj) {
+ return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
+ }
+
+ // Is a given value a DOM element?
+ function isElement(obj) {
+ return !!(obj && obj.nodeType === 1);
+ }
+
+ // Internal function for creating a `toString`-based type tester.
+ function tagTester(name) {
+ var tag = '[object ' + name + ']';
+ return function(obj) {
+ return toString.call(obj) === tag;
+ };
+ }
+
+ var isString = tagTester('String');
+
+ var isNumber = tagTester('Number');
+
+ var isDate = tagTester('Date');
+
+ var isRegExp = tagTester('RegExp');
+
+ var isError = tagTester('Error');
+
+ var isSymbol = tagTester('Symbol');
+
+ var isArrayBuffer = tagTester('ArrayBuffer');
+
+ var isFunction = tagTester('Function');
+
+ // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
+ // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
+ var nodelist = root.document && root.document.childNodes;
+ if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
+ isFunction = function(obj) {
+ return typeof obj == 'function' || false;
+ };
+ }
+
+ var isFunction$1 = isFunction;
+
+ var hasObjectTag = tagTester('Object');
+
+ // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
+ // In IE 11, the most common among them, this problem also applies to
+ // `Map`, `WeakMap` and `Set`.
+ var hasStringTagBug = (
+ supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8)))
+ ),
+ isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));
+
+ var isDataView = tagTester('DataView');
+
+ // In IE 10 - Edge 13, we need a different heuristic
+ // to determine whether an object is a `DataView`.
+ function ie10IsDataView(obj) {
+ return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer);
+ }
+
+ var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView);
+
+ // Is a given value an array?
+ // Delegates to ECMA5's native `Array.isArray`.
+ var isArray = nativeIsArray || tagTester('Array');
+
+ // Internal function to check whether `key` is an own property name of `obj`.
+ function has$1(obj, key) {
+ return obj != null && hasOwnProperty.call(obj, key);
+ }
+
+ var isArguments = tagTester('Arguments');
+
+ // Define a fallback version of the method in browsers (ahem, IE < 9), where
+ // there isn't any inspectable "Arguments" type.
+ (function() {
+ if (!isArguments(arguments)) {
+ isArguments = function(obj) {
+ return has$1(obj, 'callee');
+ };
+ }
+ }());
+
+ var isArguments$1 = isArguments;
+
+ // Is a given object a finite number?
+ function isFinite$1(obj) {
+ return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
+ }
+
+ // Is the given value `NaN`?
+ function isNaN$1(obj) {
+ return isNumber(obj) && _isNaN(obj);
+ }
+
+ // Predicate-generating function. Often useful outside of Underscore.
+ function constant(value) {
+ return function() {
+ return value;
+ };
+ }
+
+ // Common internal logic for `isArrayLike` and `isBufferLike`.
+ function createSizePropertyCheck(getSizeProperty) {
+ return function(collection) {
+ var sizeProperty = getSizeProperty(collection);
+ return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
+ }
+ }
+
+ // Internal helper to generate a function to obtain property `key` from `obj`.
+ function shallowProperty(key) {
+ return function(obj) {
+ return obj == null ? void 0 : obj[key];
+ };
+ }
+
+ // Internal helper to obtain the `byteLength` property of an object.
+ var getByteLength = shallowProperty('byteLength');
+
+ // Internal helper to determine whether we should spend extensive checks against
+ // `ArrayBuffer` et al.
+ var isBufferLike = createSizePropertyCheck(getByteLength);
+
+ // Is a given value a typed array?
+ var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
+ function isTypedArray(obj) {
+ // `ArrayBuffer.isView` is the most future-proof, so use it when available.
+ // Otherwise, fall back on the above regular expression.
+ return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) :
+ isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
+ }
+
+ var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
+
+ // Internal helper to obtain the `length` property of an object.
+ var getLength = shallowProperty('length');
+
+ // Internal helper to create a simple lookup structure.
+ // `collectNonEnumProps` used to depend on `_.contains`, but this led to
+ // circular imports. `emulatedSet` is a one-off solution that only works for
+ // arrays of strings.
+ function emulatedSet(keys) {
+ var hash = {};
+ for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
+ return {
+ contains: function(key) { return hash[key]; },
+ push: function(key) {
+ hash[key] = true;
+ return keys.push(key);
+ }
+ };
+ }
+
+ // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
+ // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
+ // needed.
+ function collectNonEnumProps(obj, keys) {
+ keys = emulatedSet(keys);
+ var nonEnumIdx = nonEnumerableProps.length;
+ var constructor = obj.constructor;
+ var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;
+
+ // Constructor is a special case.
+ var prop = 'constructor';
+ if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop);
+
+ while (nonEnumIdx--) {
+ prop = nonEnumerableProps[nonEnumIdx];
+ if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
+ keys.push(prop);
+ }
+ }
+ }
+
+ // Retrieve the names of an object's own properties.
+ // Delegates to **ECMAScript 5**'s native `Object.keys`.
+ function keys(obj) {
+ if (!isObject(obj)) return [];
+ if (nativeKeys) return nativeKeys(obj);
+ var keys = [];
+ for (var key in obj) if (has$1(obj, key)) keys.push(key);
+ // Ahem, IE < 9.
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
+ return keys;
+ }
+
+ // Is a given array, string, or object empty?
+ // An "empty" object has no enumerable own-properties.
+ function isEmpty(obj) {
+ if (obj == null) return true;
+ // Skip the more expensive `toString`-based type checks if `obj` has no
+ // `.length`.
+ var length = getLength(obj);
+ if (typeof length == 'number' && (
+ isArray(obj) || isString(obj) || isArguments$1(obj)
+ )) return length === 0;
+ return getLength(keys(obj)) === 0;
+ }
+
+ // Returns whether an object has a given set of `key:value` pairs.
+ function isMatch(object, attrs) {
+ var _keys = keys(attrs), length = _keys.length;
+ if (object == null) return !length;
+ var obj = Object(object);
+ for (var i = 0; i < length; i++) {
+ var key = _keys[i];
+ if (attrs[key] !== obj[key] || !(key in obj)) return false;
+ }
+ return true;
+ }
+
+ // If Underscore is called as a function, it returns a wrapped object that can
+ // be used OO-style. This wrapper holds altered versions of all functions added
+ // through `_.mixin`. Wrapped objects may be chained.
+ function _$1(obj) {
+ if (obj instanceof _$1) return obj;
+ if (!(this instanceof _$1)) return new _$1(obj);
+ this._wrapped = obj;
+ }
+
+ _$1.VERSION = VERSION;
+
+ // Extracts the result from a wrapped and chained object.
+ _$1.prototype.value = function() {
+ return this._wrapped;
+ };
+
+ // Provide unwrapping proxies for some methods used in engine operations
+ // such as arithmetic and JSON stringification.
+ _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value;
+
+ _$1.prototype.toString = function() {
+ return String(this._wrapped);
+ };
+
+ // Internal function to wrap or shallow-copy an ArrayBuffer,
+ // typed array or DataView to a new view, reusing the buffer.
+ function toBufferView(bufferSource) {
+ return new Uint8Array(
+ bufferSource.buffer || bufferSource,
+ bufferSource.byteOffset || 0,
+ getByteLength(bufferSource)
+ );
+ }
+
+ // We use this string twice, so give it a name for minification.
+ var tagDataView = '[object DataView]';
+
+ // Internal recursive comparison function for `_.isEqual`.
+ function eq(a, b, aStack, bStack) {
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
+ // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
+ if (a === b) return a !== 0 || 1 / a === 1 / b;
+ // `null` or `undefined` only equal to itself (strict comparison).
+ if (a == null || b == null) return false;
+ // `NaN`s are equivalent, but non-reflexive.
+ if (a !== a) return b !== b;
+ // Exhaust primitive checks
+ var type = typeof a;
+ if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
+ return deepEq(a, b, aStack, bStack);
+ }
+
+ // Internal recursive comparison function for `_.isEqual`.
+ function deepEq(a, b, aStack, bStack) {
+ // Unwrap any wrapped objects.
+ if (a instanceof _$1) a = a._wrapped;
+ if (b instanceof _$1) b = b._wrapped;
+ // Compare `[[Class]]` names.
+ var className = toString.call(a);
+ if (className !== toString.call(b)) return false;
+ // Work around a bug in IE 10 - Edge 13.
+ if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {
+ if (!isDataView$1(b)) return false;
+ className = tagDataView;
+ }
+ switch (className) {
+ // These types are compared by value.
+ case '[object RegExp]':
+ // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
+ case '[object String]':
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+ // equivalent to `new String("5")`.
+ return '' + a === '' + b;
+ case '[object Number]':
+ // `NaN`s are equivalent, but non-reflexive.
+ // Object(NaN) is equivalent to NaN.
+ if (+a !== +a) return +b !== +b;
+ // An `egal` comparison is performed for other numeric values.
+ return +a === 0 ? 1 / +a === 1 / b : +a === +b;
+ case '[object Date]':
+ case '[object Boolean]':
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+ // millisecond representations. Note that invalid dates with millisecond representations
+ // of `NaN` are not equivalent.
+ return +a === +b;
+ case '[object Symbol]':
+ return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
+ case '[object ArrayBuffer]':
+ case tagDataView:
+ // Coerce to typed array so we can fall through.
+ return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);
+ }
+
+ var areArrays = className === '[object Array]';
+ if (!areArrays && isTypedArray$1(a)) {
+ var byteLength = getByteLength(a);
+ if (byteLength !== getByteLength(b)) return false;
+ if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
+ areArrays = true;
+ }
+ if (!areArrays) {
+ if (typeof a != 'object' || typeof b != 'object') return false;
+
+ // Objects with different constructors are not equivalent, but `Object`s or `Array`s
+ // from different frames are.
+ var aCtor = a.constructor, bCtor = b.constructor;
+ if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
+ isFunction$1(bCtor) && bCtor instanceof bCtor)
+ && ('constructor' in a && 'constructor' in b)) {
+ return false;
+ }
+ }
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+
+ // Initializing stack of traversed objects.
+ // It's done here since we only need them for objects and arrays comparison.
+ aStack = aStack || [];
+ bStack = bStack || [];
+ var length = aStack.length;
+ while (length--) {
+ // Linear search. Performance is inversely proportional to the number of
+ // unique nested structures.
+ if (aStack[length] === a) return bStack[length] === b;
+ }
+
+ // Add the first object to the stack of traversed objects.
+ aStack.push(a);
+ bStack.push(b);
+
+ // Recursively compare objects and arrays.
+ if (areArrays) {
+ // Compare array lengths to determine if a deep comparison is necessary.
+ length = a.length;
+ if (length !== b.length) return false;
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (length--) {
+ if (!eq(a[length], b[length], aStack, bStack)) return false;
+ }
+ } else {
+ // Deep compare objects.
+ var _keys = keys(a), key;
+ length = _keys.length;
+ // Ensure that both objects contain the same number of properties before comparing deep equality.
+ if (keys(b).length !== length) return false;
+ while (length--) {
+ // Deep compare each member
+ key = _keys[length];
+ if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
+ }
+ }
+ // Remove the first object from the stack of traversed objects.
+ aStack.pop();
+ bStack.pop();
+ return true;
+ }
+
+ // Perform a deep comparison to check if two objects are equal.
+ function isEqual(a, b) {
+ return eq(a, b);
+ }
+
+ // Retrieve all the enumerable property names of an object.
+ function allKeys(obj) {
+ if (!isObject(obj)) return [];
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ // Ahem, IE < 9.
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
+ return keys;
+ }
+
+ // Since the regular `Object.prototype.toString` type tests don't work for
+ // some types in IE 11, we use a fingerprinting heuristic instead, based
+ // on the methods. It's not great, but it's the best we got.
+ // The fingerprint method lists are defined below.
+ function ie11fingerprint(methods) {
+ var length = getLength(methods);
+ return function(obj) {
+ if (obj == null) return false;
+ // `Map`, `WeakMap` and `Set` have no enumerable keys.
+ var keys = allKeys(obj);
+ if (getLength(keys)) return false;
+ for (var i = 0; i < length; i++) {
+ if (!isFunction$1(obj[methods[i]])) return false;
+ }
+ // If we are testing against `WeakMap`, we need to ensure that
+ // `obj` doesn't have a `forEach` method in order to distinguish
+ // it from a regular `Map`.
+ return methods !== weakMapMethods || !isFunction$1(obj[forEachName]);
+ };
+ }
+
+ // In the interest of compact minification, we write
+ // each string in the fingerprints only once.
+ var forEachName = 'forEach',
+ hasName = 'has',
+ commonInit = ['clear', 'delete'],
+ mapTail = ['get', hasName, 'set'];
+
+ // `Map`, `WeakMap` and `Set` each have slightly different
+ // combinations of the above sublists.
+ var mapMethods = commonInit.concat(forEachName, mapTail),
+ weakMapMethods = commonInit.concat(mapTail),
+ setMethods = ['add'].concat(commonInit, forEachName, hasName);
+
+ var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');
+
+ var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');
+
+ var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');
+
+ var isWeakSet = tagTester('WeakSet');
+
+ // Retrieve the values of an object's properties.
+ function values(obj) {
+ var _keys = keys(obj);
+ var length = _keys.length;
+ var values = Array(length);
+ for (var i = 0; i < length; i++) {
+ values[i] = obj[_keys[i]];
+ }
+ return values;
+ }
+
+ // Convert an object into a list of `[key, value]` pairs.
+ // The opposite of `_.object` with one argument.
+ function pairs(obj) {
+ var _keys = keys(obj);
+ var length = _keys.length;
+ var pairs = Array(length);
+ for (var i = 0; i < length; i++) {
+ pairs[i] = [_keys[i], obj[_keys[i]]];
+ }
+ return pairs;
+ }
+
+ // Invert the keys and values of an object. The values must be serializable.
+ function invert(obj) {
+ var result = {};
+ var _keys = keys(obj);
+ for (var i = 0, length = _keys.length; i < length; i++) {
+ result[obj[_keys[i]]] = _keys[i];
+ }
+ return result;
+ }
+
+ // Return a sorted list of the function names available on the object.
+ function functions(obj) {
+ var names = [];
+ for (var key in obj) {
+ if (isFunction$1(obj[key])) names.push(key);
+ }
+ return names.sort();
+ }
+
+ // An internal function for creating assigner functions.
+ function createAssigner(keysFunc, defaults) {
+ return function(obj) {
+ var length = arguments.length;
+ if (defaults) obj = Object(obj);
+ if (length < 2 || obj == null) return obj;
+ for (var index = 1; index < length; index++) {
+ var source = arguments[index],
+ keys = keysFunc(source),
+ l = keys.length;
+ for (var i = 0; i < l; i++) {
+ var key = keys[i];
+ if (!defaults || obj[key] === void 0) obj[key] = source[key];
+ }
+ }
+ return obj;
+ };
+ }
+
+ // Extend a given object with all the properties in passed-in object(s).
+ var extend = createAssigner(allKeys);
+
+ // Assigns a given object with all the own properties in the passed-in
+ // object(s).
+ // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
+ var extendOwn = createAssigner(keys);
+
+ // Fill in a given object with default properties.
+ var defaults = createAssigner(allKeys, true);
+
+ // Create a naked function reference for surrogate-prototype-swapping.
+ function ctor() {
+ return function(){};
+ }
+
+ // An internal function for creating a new object that inherits from another.
+ function baseCreate(prototype) {
+ if (!isObject(prototype)) return {};
+ if (nativeCreate) return nativeCreate(prototype);
+ var Ctor = ctor();
+ Ctor.prototype = prototype;
+ var result = new Ctor;
+ Ctor.prototype = null;
+ return result;
+ }
+
+ // Creates an object that inherits from the given prototype object.
+ // If additional properties are provided then they will be added to the
+ // created object.
+ function create(prototype, props) {
+ var result = baseCreate(prototype);
+ if (props) extendOwn(result, props);
+ return result;
+ }
+
+ // Create a (shallow-cloned) duplicate of an object.
+ function clone(obj) {
+ if (!isObject(obj)) return obj;
+ return isArray(obj) ? obj.slice() : extend({}, obj);
+ }
+
+ // Invokes `interceptor` with the `obj` and then returns `obj`.
+ // The primary purpose of this method is to "tap into" a method chain, in
+ // order to perform operations on intermediate results within the chain.
+ function tap(obj, interceptor) {
+ interceptor(obj);
+ return obj;
+ }
+
+ // Normalize a (deep) property `path` to array.
+ // Like `_.iteratee`, this function can be customized.
+ function toPath$1(path) {
+ return isArray(path) ? path : [path];
+ }
+ _$1.toPath = toPath$1;
+
+ // Internal wrapper for `_.toPath` to enable minification.
+ // Similar to `cb` for `_.iteratee`.
+ function toPath(path) {
+ return _$1.toPath(path);
+ }
+
+ // Internal function to obtain a nested property in `obj` along `path`.
+ function deepGet(obj, path) {
+ var length = path.length;
+ for (var i = 0; i < length; i++) {
+ if (obj == null) return void 0;
+ obj = obj[path[i]];
+ }
+ return length ? obj : void 0;
+ }
+
+ // Get the value of the (deep) property on `path` from `object`.
+ // If any property in `path` does not exist or if the value is
+ // `undefined`, return `defaultValue` instead.
+ // The `path` is normalized through `_.toPath`.
+ function get(object, path, defaultValue) {
+ var value = deepGet(object, toPath(path));
+ return isUndefined(value) ? defaultValue : value;
+ }
+
+ // Shortcut function for checking if an object has a given property directly on
+ // itself (in other words, not on a prototype). Unlike the internal `has`
+ // function, this public version can also traverse nested properties.
+ function has(obj, path) {
+ path = toPath(path);
+ var length = path.length;
+ for (var i = 0; i < length; i++) {
+ var key = path[i];
+ if (!has$1(obj, key)) return false;
+ obj = obj[key];
+ }
+ return !!length;
+ }
+
+ // Keep the identity function around for default iteratees.
+ function identity(value) {
+ return value;
+ }
+
+ // Returns a predicate for checking whether an object has a given set of
+ // `key:value` pairs.
+ function matcher(attrs) {
+ attrs = extendOwn({}, attrs);
+ return function(obj) {
+ return isMatch(obj, attrs);
+ };
+ }
+
+ // Creates a function that, when passed an object, will traverse that object’s
+ // properties down the given `path`, specified as an array of keys or indices.
+ function property(path) {
+ path = toPath(path);
+ return function(obj) {
+ return deepGet(obj, path);
+ };
+ }
+
+ // Internal function that returns an efficient (for current engines) version
+ // of the passed-in callback, to be repeatedly applied in other Underscore
+ // functions.
+ function optimizeCb(func, context, argCount) {
+ if (context === void 0) return func;
+ switch (argCount == null ? 3 : argCount) {
+ case 1: return function(value) {
+ return func.call(context, value);
+ };
+ // The 2-argument case is omitted because we’re not using it.
+ case 3: return function(value, index, collection) {
+ return func.call(context, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(context, accumulator, value, index, collection);
+ };
+ }
+ return function() {
+ return func.apply(context, arguments);
+ };
+ }
+
+ // An internal function to generate callbacks that can be applied to each
+ // element in a collection, returning the desired result — either `_.identity`,
+ // an arbitrary callback, a property matcher, or a property accessor.
+ function baseIteratee(value, context, argCount) {
+ if (value == null) return identity;
+ if (isFunction$1(value)) return optimizeCb(value, context, argCount);
+ if (isObject(value) && !isArray(value)) return matcher(value);
+ return property(value);
+ }
+
+ // External wrapper for our callback generator. Users may customize
+ // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
+ // This abstraction hides the internal-only `argCount` argument.
+ function iteratee(value, context) {
+ return baseIteratee(value, context, Infinity);
+ }
+ _$1.iteratee = iteratee;
+
+ // The function we call internally to generate a callback. It invokes
+ // `_.iteratee` if overridden, otherwise `baseIteratee`.
+ function cb(value, context, argCount) {
+ if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context);
+ return baseIteratee(value, context, argCount);
+ }
+
+ // Returns the results of applying the `iteratee` to each element of `obj`.
+ // In contrast to `_.map` it returns an object.
+ function mapObject(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ var _keys = keys(obj),
+ length = _keys.length,
+ results = {};
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys[index];
+ results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
+ }
+ return results;
+ }
+
+ // Predicate-generating function. Often useful outside of Underscore.
+ function noop(){}
+
+ // Generates a function for a given object that returns a given property.
+ function propertyOf(obj) {
+ if (obj == null) return noop;
+ return function(path) {
+ return get(obj, path);
+ };
+ }
+
+ // Run a function **n** times.
+ function times(n, iteratee, context) {
+ var accum = Array(Math.max(0, n));
+ iteratee = optimizeCb(iteratee, context, 1);
+ for (var i = 0; i < n; i++) accum[i] = iteratee(i);
+ return accum;
+ }
+
+ // Return a random integer between `min` and `max` (inclusive).
+ function random(min, max) {
+ if (max == null) {
+ max = min;
+ min = 0;
+ }
+ return min + Math.floor(Math.random() * (max - min + 1));
+ }
+
+ // A (possibly faster) way to get the current timestamp as an integer.
+ var now = Date.now || function() {
+ return new Date().getTime();
+ };
+
+ // Internal helper to generate functions for escaping and unescaping strings
+ // to/from HTML interpolation.
+ function createEscaper(map) {
+ var escaper = function(match) {
+ return map[match];
+ };
+ // Regexes for identifying a key that needs to be escaped.
+ var source = '(?:' + keys(map).join('|') + ')';
+ var testRegexp = RegExp(source);
+ var replaceRegexp = RegExp(source, 'g');
+ return function(string) {
+ string = string == null ? '' : '' + string;
+ return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
+ };
+ }
+
+ // Internal list of HTML entities for escaping.
+ var escapeMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '`': '`'
+ };
+
+ // Function for escaping strings to HTML interpolation.
+ var _escape = createEscaper(escapeMap);
+
+ // Internal list of HTML entities for unescaping.
+ var unescapeMap = invert(escapeMap);
+
+ // Function for unescaping strings from HTML interpolation.
+ var _unescape = createEscaper(unescapeMap);
+
+ // By default, Underscore uses ERB-style template delimiters. Change the
+ // following template settings to use alternative delimiters.
+ var templateSettings = _$1.templateSettings = {
+ evaluate: /<%([\s\S]+?)%>/g,
+ interpolate: /<%=([\s\S]+?)%>/g,
+ escape: /<%-([\s\S]+?)%>/g
+ };
+
+ // When customizing `_.templateSettings`, if you don't want to define an
+ // interpolation, evaluation or escaping regex, we need one that is
+ // guaranteed not to match.
+ var noMatch = /(.)^/;
+
+ // Certain characters need to be escaped so that they can be put into a
+ // string literal.
+ var escapes = {
+ "'": "'",
+ '\\': '\\',
+ '\r': 'r',
+ '\n': 'n',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+ };
+
+ var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
+
+ function escapeChar(match) {
+ return '\\' + escapes[match];
+ }
+
+ // In order to prevent third-party code injection through
+ // `_.templateSettings.variable`, we test it against the following regular
+ // expression. It is intentionally a bit more liberal than just matching valid
+ // identifiers, but still prevents possible loopholes through defaults or
+ // destructuring assignment.
+ var bareIdentifier = /^\s*(\w|\$)+\s*$/;
+
+ // JavaScript micro-templating, similar to John Resig's implementation.
+ // Underscore templating handles arbitrary delimiters, preserves whitespace,
+ // and correctly escapes quotes within interpolated code.
+ // NB: `oldSettings` only exists for backwards compatibility.
+ function template(text, settings, oldSettings) {
+ if (!settings && oldSettings) settings = oldSettings;
+ settings = defaults({}, settings, _$1.templateSettings);
+
+ // Combine delimiters into one regular expression via alternation.
+ var matcher = RegExp([
+ (settings.escape || noMatch).source,
+ (settings.interpolate || noMatch).source,
+ (settings.evaluate || noMatch).source
+ ].join('|') + '|$', 'g');
+
+ // Compile the template source, escaping string literals appropriately.
+ var index = 0;
+ var source = "__p+='";
+ text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+ source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
+ index = offset + match.length;
+
+ if (escape) {
+ source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+ } else if (interpolate) {
+ source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+ } else if (evaluate) {
+ source += "';\n" + evaluate + "\n__p+='";
+ }
+
+ // Adobe VMs need the match returned to produce the correct offset.
+ return match;
+ });
+ source += "';\n";
+
+ var argument = settings.variable;
+ if (argument) {
+ // Insure against third-party code injection. (CVE-2021-23358)
+ if (!bareIdentifier.test(argument)) throw new Error(
+ 'variable is not a bare identifier: ' + argument
+ );
+ } else {
+ // If a variable is not specified, place data values in local scope.
+ source = 'with(obj||{}){\n' + source + '}\n';
+ argument = 'obj';
+ }
+
+ source = "var __t,__p='',__j=Array.prototype.join," +
+ "print=function(){__p+=__j.call(arguments,'');};\n" +
+ source + 'return __p;\n';
+
+ var render;
+ try {
+ render = new Function(argument, '_', source);
+ } catch (e) {
+ e.source = source;
+ throw e;
+ }
+
+ var template = function(data) {
+ return render.call(this, data, _$1);
+ };
+
+ // Provide the compiled source as a convenience for precompilation.
+ template.source = 'function(' + argument + '){\n' + source + '}';
+
+ return template;
+ }
+
+ // Traverses the children of `obj` along `path`. If a child is a function, it
+ // is invoked with its parent as context. Returns the value of the final
+ // child, or `fallback` if any child is undefined.
+ function result(obj, path, fallback) {
+ path = toPath(path);
+ var length = path.length;
+ if (!length) {
+ return isFunction$1(fallback) ? fallback.call(obj) : fallback;
+ }
+ for (var i = 0; i < length; i++) {
+ var prop = obj == null ? void 0 : obj[path[i]];
+ if (prop === void 0) {
+ prop = fallback;
+ i = length; // Ensure we don't continue iterating.
+ }
+ obj = isFunction$1(prop) ? prop.call(obj) : prop;
+ }
+ return obj;
+ }
+
+ // Generate a unique integer id (unique within the entire client session).
+ // Useful for temporary DOM ids.
+ var idCounter = 0;
+ function uniqueId(prefix) {
+ var id = ++idCounter + '';
+ return prefix ? prefix + id : id;
+ }
+
+ // Start chaining a wrapped Underscore object.
+ function chain(obj) {
+ var instance = _$1(obj);
+ instance._chain = true;
+ return instance;
+ }
+
+ // Internal function to execute `sourceFunc` bound to `context` with optional
+ // `args`. Determines whether to execute a function as a constructor or as a
+ // normal function.
+ function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
+ if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
+ var self = baseCreate(sourceFunc.prototype);
+ var result = sourceFunc.apply(self, args);
+ if (isObject(result)) return result;
+ return self;
+ }
+
+ // Partially apply a function by creating a version that has had some of its
+ // arguments pre-filled, without changing its dynamic `this` context. `_` acts
+ // as a placeholder by default, allowing any combination of arguments to be
+ // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
+ var partial = restArguments(function(func, boundArgs) {
+ var placeholder = partial.placeholder;
+ var bound = function() {
+ var position = 0, length = boundArgs.length;
+ var args = Array(length);
+ for (var i = 0; i < length; i++) {
+ args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
+ }
+ while (position < arguments.length) args.push(arguments[position++]);
+ return executeBound(func, bound, this, this, args);
+ };
+ return bound;
+ });
+
+ partial.placeholder = _$1;
+
+ // Create a function bound to a given object (assigning `this`, and arguments,
+ // optionally).
+ var bind = restArguments(function(func, context, args) {
+ if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
+ var bound = restArguments(function(callArgs) {
+ return executeBound(func, bound, context, this, args.concat(callArgs));
+ });
+ return bound;
+ });
+
+ // Internal helper for collection methods to determine whether a collection
+ // should be iterated as an array or as an object.
+ // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
+ // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
+ var isArrayLike = createSizePropertyCheck(getLength);
+
+ // Internal implementation of a recursive `flatten` function.
+ function flatten$1(input, depth, strict, output) {
+ output = output || [];
+ if (!depth && depth !== 0) {
+ depth = Infinity;
+ } else if (depth <= 0) {
+ return output.concat(input);
+ }
+ var idx = output.length;
+ for (var i = 0, length = getLength(input); i < length; i++) {
+ var value = input[i];
+ if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
+ // Flatten current level of array or arguments object.
+ if (depth > 1) {
+ flatten$1(value, depth - 1, strict, output);
+ idx = output.length;
+ } else {
+ var j = 0, len = value.length;
+ while (j < len) output[idx++] = value[j++];
+ }
+ } else if (!strict) {
+ output[idx++] = value;
+ }
+ }
+ return output;
+ }
+
+ // Bind a number of an object's methods to that object. Remaining arguments
+ // are the method names to be bound. Useful for ensuring that all callbacks
+ // defined on an object belong to it.
+ var bindAll = restArguments(function(obj, keys) {
+ keys = flatten$1(keys, false, false);
+ var index = keys.length;
+ if (index < 1) throw new Error('bindAll must be passed function names');
+ while (index--) {
+ var key = keys[index];
+ obj[key] = bind(obj[key], obj);
+ }
+ return obj;
+ });
+
+ // Memoize an expensive function by storing its results.
+ function memoize(func, hasher) {
+ var memoize = function(key) {
+ var cache = memoize.cache;
+ var address = '' + (hasher ? hasher.apply(this, arguments) : key);
+ if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);
+ return cache[address];
+ };
+ memoize.cache = {};
+ return memoize;
+ }
+
+ // Delays a function for the given number of milliseconds, and then calls
+ // it with the arguments supplied.
+ var delay = restArguments(function(func, wait, args) {
+ return setTimeout(function() {
+ return func.apply(null, args);
+ }, wait);
+ });
+
+ // Defers a function, scheduling it to run after the current call stack has
+ // cleared.
+ var defer = partial(delay, _$1, 1);
+
+ // Returns a function, that, when invoked, will only be triggered at most once
+ // during a given window of time. Normally, the throttled function will run
+ // as much as it can, without ever going more than once per `wait` duration;
+ // but if you'd like to disable the execution on the leading edge, pass
+ // `{leading: false}`. To disable execution on the trailing edge, ditto.
+ function throttle(func, wait, options) {
+ var timeout, context, args, result;
+ var previous = 0;
+ if (!options) options = {};
+
+ var later = function() {
+ previous = options.leading === false ? 0 : now();
+ timeout = null;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ };
+
+ var throttled = function() {
+ var _now = now();
+ if (!previous && options.leading === false) previous = _now;
+ var remaining = wait - (_now - previous);
+ context = this;
+ args = arguments;
+ if (remaining <= 0 || remaining > wait) {
+ if (timeout) {
+ clearTimeout(timeout);
+ timeout = null;
+ }
+ previous = _now;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ } else if (!timeout && options.trailing !== false) {
+ timeout = setTimeout(later, remaining);
+ }
+ return result;
+ };
+
+ throttled.cancel = function() {
+ clearTimeout(timeout);
+ previous = 0;
+ timeout = context = args = null;
+ };
+
+ return throttled;
+ }
+
+ // When a sequence of calls of the returned function ends, the argument
+ // function is triggered. The end of a sequence is defined by the `wait`
+ // parameter. If `immediate` is passed, the argument function will be
+ // triggered at the beginning of the sequence instead of at the end.
+ function debounce(func, wait, immediate) {
+ var timeout, previous, args, result, context;
+
+ var later = function() {
+ var passed = now() - previous;
+ if (wait > passed) {
+ timeout = setTimeout(later, wait - passed);
+ } else {
+ timeout = null;
+ if (!immediate) result = func.apply(context, args);
+ // This check is needed because `func` can recursively invoke `debounced`.
+ if (!timeout) args = context = null;
+ }
+ };
+
+ var debounced = restArguments(function(_args) {
+ context = this;
+ args = _args;
+ previous = now();
+ if (!timeout) {
+ timeout = setTimeout(later, wait);
+ if (immediate) result = func.apply(context, args);
+ }
+ return result;
+ });
+
+ debounced.cancel = function() {
+ clearTimeout(timeout);
+ timeout = args = context = null;
+ };
+
+ return debounced;
+ }
+
+ // Returns the first function passed as an argument to the second,
+ // allowing you to adjust arguments, run code before and after, and
+ // conditionally execute the original function.
+ function wrap(func, wrapper) {
+ return partial(wrapper, func);
+ }
+
+ // Returns a negated version of the passed-in predicate.
+ function negate(predicate) {
+ return function() {
+ return !predicate.apply(this, arguments);
+ };
+ }
+
+ // Returns a function that is the composition of a list of functions, each
+ // consuming the return value of the function that follows.
+ function compose() {
+ var args = arguments;
+ var start = args.length - 1;
+ return function() {
+ var i = start;
+ var result = args[start].apply(this, arguments);
+ while (i--) result = args[i].call(this, result);
+ return result;
+ };
+ }
+
+ // Returns a function that will only be executed on and after the Nth call.
+ function after(times, func) {
+ return function() {
+ if (--times < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ }
+
+ // Returns a function that will only be executed up to (but not including) the
+ // Nth call.
+ function before(times, func) {
+ var memo;
+ return function() {
+ if (--times > 0) {
+ memo = func.apply(this, arguments);
+ }
+ if (times <= 1) func = null;
+ return memo;
+ };
+ }
+
+ // Returns a function that will be executed at most one time, no matter how
+ // often you call it. Useful for lazy initialization.
+ var once = partial(before, 2);
+
+ // Returns the first key on an object that passes a truth test.
+ function findKey(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var _keys = keys(obj), key;
+ for (var i = 0, length = _keys.length; i < length; i++) {
+ key = _keys[i];
+ if (predicate(obj[key], key, obj)) return key;
+ }
+ }
+
+ // Internal function to generate `_.findIndex` and `_.findLastIndex`.
+ function createPredicateIndexFinder(dir) {
+ return function(array, predicate, context) {
+ predicate = cb(predicate, context);
+ var length = getLength(array);
+ var index = dir > 0 ? 0 : length - 1;
+ for (; index >= 0 && index < length; index += dir) {
+ if (predicate(array[index], index, array)) return index;
+ }
+ return -1;
+ };
+ }
+
+ // Returns the first index on an array-like that passes a truth test.
+ var findIndex = createPredicateIndexFinder(1);
+
+ // Returns the last index on an array-like that passes a truth test.
+ var findLastIndex = createPredicateIndexFinder(-1);
+
+ // Use a comparator function to figure out the smallest index at which
+ // an object should be inserted so as to maintain order. Uses binary search.
+ function sortedIndex(array, obj, iteratee, context) {
+ iteratee = cb(iteratee, context, 1);
+ var value = iteratee(obj);
+ var low = 0, high = getLength(array);
+ while (low < high) {
+ var mid = Math.floor((low + high) / 2);
+ if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
+ }
+ return low;
+ }
+
+ // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
+ function createIndexFinder(dir, predicateFind, sortedIndex) {
+ return function(array, item, idx) {
+ var i = 0, length = getLength(array);
+ if (typeof idx == 'number') {
+ if (dir > 0) {
+ i = idx >= 0 ? idx : Math.max(idx + length, i);
+ } else {
+ length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
+ }
+ } else if (sortedIndex && idx && length) {
+ idx = sortedIndex(array, item);
+ return array[idx] === item ? idx : -1;
+ }
+ if (item !== item) {
+ idx = predicateFind(slice.call(array, i, length), isNaN$1);
+ return idx >= 0 ? idx + i : -1;
+ }
+ for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
+ if (array[idx] === item) return idx;
+ }
+ return -1;
+ };
+ }
+
+ // Return the position of the first occurrence of an item in an array,
+ // or -1 if the item is not included in the array.
+ // If the array is large and already in sort order, pass `true`
+ // for **isSorted** to use binary search.
+ var indexOf = createIndexFinder(1, findIndex, sortedIndex);
+
+ // Return the position of the last occurrence of an item in an array,
+ // or -1 if the item is not included in the array.
+ var lastIndexOf = createIndexFinder(-1, findLastIndex);
+
+ // Return the first value which passes a truth test.
+ function find(obj, predicate, context) {
+ var keyFinder = isArrayLike(obj) ? findIndex : findKey;
+ var key = keyFinder(obj, predicate, context);
+ if (key !== void 0 && key !== -1) return obj[key];
+ }
+
+ // Convenience version of a common use case of `_.find`: getting the first
+ // object containing specific `key:value` pairs.
+ function findWhere(obj, attrs) {
+ return find(obj, matcher(attrs));
+ }
+
+ // The cornerstone for collection functions, an `each`
+ // implementation, aka `forEach`.
+ // Handles raw objects in addition to array-likes. Treats all
+ // sparse array-likes as if they were dense.
+ function each(obj, iteratee, context) {
+ iteratee = optimizeCb(iteratee, context);
+ var i, length;
+ if (isArrayLike(obj)) {
+ for (i = 0, length = obj.length; i < length; i++) {
+ iteratee(obj[i], i, obj);
+ }
+ } else {
+ var _keys = keys(obj);
+ for (i = 0, length = _keys.length; i < length; i++) {
+ iteratee(obj[_keys[i]], _keys[i], obj);
+ }
+ }
+ return obj;
+ }
+
+ // Return the results of applying the iteratee to each element.
+ function map(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length,
+ results = Array(length);
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys ? _keys[index] : index;
+ results[index] = iteratee(obj[currentKey], currentKey, obj);
+ }
+ return results;
+ }
+
+ // Internal helper to create a reducing function, iterating left or right.
+ function createReduce(dir) {
+ // Wrap code that reassigns argument variables in a separate function than
+ // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
+ var reducer = function(obj, iteratee, memo, initial) {
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length,
+ index = dir > 0 ? 0 : length - 1;
+ if (!initial) {
+ memo = obj[_keys ? _keys[index] : index];
+ index += dir;
+ }
+ for (; index >= 0 && index < length; index += dir) {
+ var currentKey = _keys ? _keys[index] : index;
+ memo = iteratee(memo, obj[currentKey], currentKey, obj);
+ }
+ return memo;
+ };
+
+ return function(obj, iteratee, memo, context) {
+ var initial = arguments.length >= 3;
+ return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
+ };
+ }
+
+ // **Reduce** builds up a single result from a list of values, aka `inject`,
+ // or `foldl`.
+ var reduce = createReduce(1);
+
+ // The right-associative version of reduce, also known as `foldr`.
+ var reduceRight = createReduce(-1);
+
+ // Return all the elements that pass a truth test.
+ function filter(obj, predicate, context) {
+ var results = [];
+ predicate = cb(predicate, context);
+ each(obj, function(value, index, list) {
+ if (predicate(value, index, list)) results.push(value);
+ });
+ return results;
+ }
+
+ // Return all the elements for which a truth test fails.
+ function reject(obj, predicate, context) {
+ return filter(obj, negate(cb(predicate)), context);
+ }
+
+ // Determine whether all of the elements pass a truth test.
+ function every(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length;
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys ? _keys[index] : index;
+ if (!predicate(obj[currentKey], currentKey, obj)) return false;
+ }
+ return true;
+ }
+
+ // Determine if at least one element in the object passes a truth test.
+ function some(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length;
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys ? _keys[index] : index;
+ if (predicate(obj[currentKey], currentKey, obj)) return true;
+ }
+ return false;
+ }
+
+ // Determine if the array or object contains a given item (using `===`).
+ function contains(obj, item, fromIndex, guard) {
+ if (!isArrayLike(obj)) obj = values(obj);
+ if (typeof fromIndex != 'number' || guard) fromIndex = 0;
+ return indexOf(obj, item, fromIndex) >= 0;
+ }
+
+ // Invoke a method (with arguments) on every item in a collection.
+ var invoke = restArguments(function(obj, path, args) {
+ var contextPath, func;
+ if (isFunction$1(path)) {
+ func = path;
+ } else {
+ path = toPath(path);
+ contextPath = path.slice(0, -1);
+ path = path[path.length - 1];
+ }
+ return map(obj, function(context) {
+ var method = func;
+ if (!method) {
+ if (contextPath && contextPath.length) {
+ context = deepGet(context, contextPath);
+ }
+ if (context == null) return void 0;
+ method = context[path];
+ }
+ return method == null ? method : method.apply(context, args);
+ });
+ });
+
+ // Convenience version of a common use case of `_.map`: fetching a property.
+ function pluck(obj, key) {
+ return map(obj, property(key));
+ }
+
+ // Convenience version of a common use case of `_.filter`: selecting only
+ // objects containing specific `key:value` pairs.
+ function where(obj, attrs) {
+ return filter(obj, matcher(attrs));
+ }
+
+ // Return the maximum element (or element-based computation).
+ function max(obj, iteratee, context) {
+ var result = -Infinity, lastComputed = -Infinity,
+ value, computed;
+ if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
+ obj = isArrayLike(obj) ? obj : values(obj);
+ for (var i = 0, length = obj.length; i < length; i++) {
+ value = obj[i];
+ if (value != null && value > result) {
+ result = value;
+ }
+ }
+ } else {
+ iteratee = cb(iteratee, context);
+ each(obj, function(v, index, list) {
+ computed = iteratee(v, index, list);
+ if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
+ result = v;
+ lastComputed = computed;
+ }
+ });
+ }
+ return result;
+ }
+
+ // Return the minimum element (or element-based computation).
+ function min(obj, iteratee, context) {
+ var result = Infinity, lastComputed = Infinity,
+ value, computed;
+ if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
+ obj = isArrayLike(obj) ? obj : values(obj);
+ for (var i = 0, length = obj.length; i < length; i++) {
+ value = obj[i];
+ if (value != null && value < result) {
+ result = value;
+ }
+ }
+ } else {
+ iteratee = cb(iteratee, context);
+ each(obj, function(v, index, list) {
+ computed = iteratee(v, index, list);
+ if (computed < lastComputed || computed === Infinity && result === Infinity) {
+ result = v;
+ lastComputed = computed;
+ }
+ });
+ }
+ return result;
+ }
+
+ // Sample **n** random values from a collection using the modern version of the
+ // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
+ // If **n** is not specified, returns a single random element.
+ // The internal `guard` argument allows it to work with `_.map`.
+ function sample(obj, n, guard) {
+ if (n == null || guard) {
+ if (!isArrayLike(obj)) obj = values(obj);
+ return obj[random(obj.length - 1)];
+ }
+ var sample = isArrayLike(obj) ? clone(obj) : values(obj);
+ var length = getLength(sample);
+ n = Math.max(Math.min(n, length), 0);
+ var last = length - 1;
+ for (var index = 0; index < n; index++) {
+ var rand = random(index, last);
+ var temp = sample[index];
+ sample[index] = sample[rand];
+ sample[rand] = temp;
+ }
+ return sample.slice(0, n);
+ }
+
+ // Shuffle a collection.
+ function shuffle(obj) {
+ return sample(obj, Infinity);
+ }
+
+ // Sort the object's values by a criterion produced by an iteratee.
+ function sortBy(obj, iteratee, context) {
+ var index = 0;
+ iteratee = cb(iteratee, context);
+ return pluck(map(obj, function(value, key, list) {
+ return {
+ value: value,
+ index: index++,
+ criteria: iteratee(value, key, list)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria;
+ var b = right.criteria;
+ if (a !== b) {
+ if (a > b || a === void 0) return 1;
+ if (a < b || b === void 0) return -1;
+ }
+ return left.index - right.index;
+ }), 'value');
+ }
+
+ // An internal function used for aggregate "group by" operations.
+ function group(behavior, partition) {
+ return function(obj, iteratee, context) {
+ var result = partition ? [[], []] : {};
+ iteratee = cb(iteratee, context);
+ each(obj, function(value, index) {
+ var key = iteratee(value, index, obj);
+ behavior(result, value, key);
+ });
+ return result;
+ };
+ }
+
+ // Groups the object's values by a criterion. Pass either a string attribute
+ // to group by, or a function that returns the criterion.
+ var groupBy = group(function(result, value, key) {
+ if (has$1(result, key)) result[key].push(value); else result[key] = [value];
+ });
+
+ // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
+ // when you know that your index values will be unique.
+ var indexBy = group(function(result, value, key) {
+ result[key] = value;
+ });
+
+ // Counts instances of an object that group by a certain criterion. Pass
+ // either a string attribute to count by, or a function that returns the
+ // criterion.
+ var countBy = group(function(result, value, key) {
+ if (has$1(result, key)) result[key]++; else result[key] = 1;
+ });
+
+ // Split a collection into two arrays: one whose elements all pass the given
+ // truth test, and one whose elements all do not pass the truth test.
+ var partition = group(function(result, value, pass) {
+ result[pass ? 0 : 1].push(value);
+ }, true);
+
+ // Safely create a real, live array from anything iterable.
+ var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
+ function toArray(obj) {
+ if (!obj) return [];
+ if (isArray(obj)) return slice.call(obj);
+ if (isString(obj)) {
+ // Keep surrogate pair characters together.
+ return obj.match(reStrSymbol);
+ }
+ if (isArrayLike(obj)) return map(obj, identity);
+ return values(obj);
+ }
+
+ // Return the number of elements in a collection.
+ function size(obj) {
+ if (obj == null) return 0;
+ return isArrayLike(obj) ? obj.length : keys(obj).length;
+ }
+
+ // Internal `_.pick` helper function to determine whether `key` is an enumerable
+ // property name of `obj`.
+ function keyInObj(value, key, obj) {
+ return key in obj;
+ }
+
+ // Return a copy of the object only containing the allowed properties.
+ var pick = restArguments(function(obj, keys) {
+ var result = {}, iteratee = keys[0];
+ if (obj == null) return result;
+ if (isFunction$1(iteratee)) {
+ if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
+ keys = allKeys(obj);
+ } else {
+ iteratee = keyInObj;
+ keys = flatten$1(keys, false, false);
+ obj = Object(obj);
+ }
+ for (var i = 0, length = keys.length; i < length; i++) {
+ var key = keys[i];
+ var value = obj[key];
+ if (iteratee(value, key, obj)) result[key] = value;
+ }
+ return result;
+ });
+
+ // Return a copy of the object without the disallowed properties.
+ var omit = restArguments(function(obj, keys) {
+ var iteratee = keys[0], context;
+ if (isFunction$1(iteratee)) {
+ iteratee = negate(iteratee);
+ if (keys.length > 1) context = keys[1];
+ } else {
+ keys = map(flatten$1(keys, false, false), String);
+ iteratee = function(value, key) {
+ return !contains(keys, key);
+ };
+ }
+ return pick(obj, iteratee, context);
+ });
+
+ // Returns everything but the last entry of the array. Especially useful on
+ // the arguments object. Passing **n** will return all the values in
+ // the array, excluding the last N.
+ function initial(array, n, guard) {
+ return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
+ }
+
+ // Get the first element of an array. Passing **n** will return the first N
+ // values in the array. The **guard** check allows it to work with `_.map`.
+ function first(array, n, guard) {
+ if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
+ if (n == null || guard) return array[0];
+ return initial(array, array.length - n);
+ }
+
+ // Returns everything but the first entry of the `array`. Especially useful on
+ // the `arguments` object. Passing an **n** will return the rest N values in the
+ // `array`.
+ function rest(array, n, guard) {
+ return slice.call(array, n == null || guard ? 1 : n);
+ }
+
+ // Get the last element of an array. Passing **n** will return the last N
+ // values in the array.
+ function last(array, n, guard) {
+ if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
+ if (n == null || guard) return array[array.length - 1];
+ return rest(array, Math.max(0, array.length - n));
+ }
+
+ // Trim out all falsy values from an array.
+ function compact(array) {
+ return filter(array, Boolean);
+ }
+
+ // Flatten out an array, either recursively (by default), or up to `depth`.
+ // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
+ function flatten(array, depth) {
+ return flatten$1(array, depth, false);
+ }
+
+ // Take the difference between one array and a number of other arrays.
+ // Only the elements present in just the first array will remain.
+ var difference = restArguments(function(array, rest) {
+ rest = flatten$1(rest, true, true);
+ return filter(array, function(value){
+ return !contains(rest, value);
+ });
+ });
+
+ // Return a version of the array that does not contain the specified value(s).
+ var without = restArguments(function(array, otherArrays) {
+ return difference(array, otherArrays);
+ });
+
+ // Produce a duplicate-free version of the array. If the array has already
+ // been sorted, you have the option of using a faster algorithm.
+ // The faster algorithm will not work with an iteratee if the iteratee
+ // is not a one-to-one function, so providing an iteratee will disable
+ // the faster algorithm.
+ function uniq(array, isSorted, iteratee, context) {
+ if (!isBoolean(isSorted)) {
+ context = iteratee;
+ iteratee = isSorted;
+ isSorted = false;
+ }
+ if (iteratee != null) iteratee = cb(iteratee, context);
+ var result = [];
+ var seen = [];
+ for (var i = 0, length = getLength(array); i < length; i++) {
+ var value = array[i],
+ computed = iteratee ? iteratee(value, i, array) : value;
+ if (isSorted && !iteratee) {
+ if (!i || seen !== computed) result.push(value);
+ seen = computed;
+ } else if (iteratee) {
+ if (!contains(seen, computed)) {
+ seen.push(computed);
+ result.push(value);
+ }
+ } else if (!contains(result, value)) {
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ // Produce an array that contains the union: each distinct element from all of
+ // the passed-in arrays.
+ var union = restArguments(function(arrays) {
+ return uniq(flatten$1(arrays, true, true));
+ });
+
+ // Produce an array that contains every item shared between all the
+ // passed-in arrays.
+ function intersection(array) {
+ var result = [];
+ var argsLength = arguments.length;
+ for (var i = 0, length = getLength(array); i < length; i++) {
+ var item = array[i];
+ if (contains(result, item)) continue;
+ var j;
+ for (j = 1; j < argsLength; j++) {
+ if (!contains(arguments[j], item)) break;
+ }
+ if (j === argsLength) result.push(item);
+ }
+ return result;
+ }
+
+ // Complement of zip. Unzip accepts an array of arrays and groups
+ // each array's elements on shared indices.
+ function unzip(array) {
+ var length = array && max(array, getLength).length || 0;
+ var result = Array(length);
+
+ for (var index = 0; index < length; index++) {
+ result[index] = pluck(array, index);
+ }
+ return result;
+ }
+
+ // Zip together multiple lists into a single array -- elements that share
+ // an index go together.
+ var zip = restArguments(unzip);
+
+ // Converts lists into objects. Pass either a single array of `[key, value]`
+ // pairs, or two parallel arrays of the same length -- one of keys, and one of
+ // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
+ function object(list, values) {
+ var result = {};
+ for (var i = 0, length = getLength(list); i < length; i++) {
+ if (values) {
+ result[list[i]] = values[i];
+ } else {
+ result[list[i][0]] = list[i][1];
+ }
+ }
+ return result;
+ }
+
+ // Generate an integer Array containing an arithmetic progression. A port of
+ // the native Python `range()` function. See
+ // [the Python documentation](https://docs.python.org/library/functions.html#range).
+ function range(start, stop, step) {
+ if (stop == null) {
+ stop = start || 0;
+ start = 0;
+ }
+ if (!step) {
+ step = stop < start ? -1 : 1;
+ }
+
+ var length = Math.max(Math.ceil((stop - start) / step), 0);
+ var range = Array(length);
+
+ for (var idx = 0; idx < length; idx++, start += step) {
+ range[idx] = start;
+ }
+
+ return range;
+ }
+
+ // Chunk a single array into multiple arrays, each containing `count` or fewer
+ // items.
+ function chunk(array, count) {
+ if (count == null || count < 1) return [];
+ var result = [];
+ var i = 0, length = array.length;
+ while (i < length) {
+ result.push(slice.call(array, i, i += count));
+ }
+ return result;
+ }
+
+ // Helper function to continue chaining intermediate results.
+ function chainResult(instance, obj) {
+ return instance._chain ? _$1(obj).chain() : obj;
+ }
+
+ // Add your own custom functions to the Underscore object.
+ function mixin(obj) {
+ each(functions(obj), function(name) {
+ var func = _$1[name] = obj[name];
+ _$1.prototype[name] = function() {
+ var args = [this._wrapped];
+ push.apply(args, arguments);
+ return chainResult(this, func.apply(_$1, args));
+ };
+ });
+ return _$1;
+ }
+
+ // Add all mutator `Array` functions to the wrapper.
+ each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+ var method = ArrayProto[name];
+ _$1.prototype[name] = function() {
+ var obj = this._wrapped;
+ if (obj != null) {
+ method.apply(obj, arguments);
+ if ((name === 'shift' || name === 'splice') && obj.length === 0) {
+ delete obj[0];
+ }
+ }
+ return chainResult(this, obj);
+ };
+ });
+
+ // Add all accessor `Array` functions to the wrapper.
+ each(['concat', 'join', 'slice'], function(name) {
+ var method = ArrayProto[name];
+ _$1.prototype[name] = function() {
+ var obj = this._wrapped;
+ if (obj != null) obj = method.apply(obj, arguments);
+ return chainResult(this, obj);
+ };
+ });
+
+ // Named Exports
+
+ var allExports = {
+ __proto__: null,
+ VERSION: VERSION,
+ restArguments: restArguments,
+ isObject: isObject,
+ isNull: isNull,
+ isUndefined: isUndefined,
+ isBoolean: isBoolean,
+ isElement: isElement,
+ isString: isString,
+ isNumber: isNumber,
+ isDate: isDate,
+ isRegExp: isRegExp,
+ isError: isError,
+ isSymbol: isSymbol,
+ isArrayBuffer: isArrayBuffer,
+ isDataView: isDataView$1,
+ isArray: isArray,
+ isFunction: isFunction$1,
+ isArguments: isArguments$1,
+ isFinite: isFinite$1,
+ isNaN: isNaN$1,
+ isTypedArray: isTypedArray$1,
+ isEmpty: isEmpty,
+ isMatch: isMatch,
+ isEqual: isEqual,
+ isMap: isMap,
+ isWeakMap: isWeakMap,
+ isSet: isSet,
+ isWeakSet: isWeakSet,
+ keys: keys,
+ allKeys: allKeys,
+ values: values,
+ pairs: pairs,
+ invert: invert,
+ functions: functions,
+ methods: functions,
+ extend: extend,
+ extendOwn: extendOwn,
+ assign: extendOwn,
+ defaults: defaults,
+ create: create,
+ clone: clone,
+ tap: tap,
+ get: get,
+ has: has,
+ mapObject: mapObject,
+ identity: identity,
+ constant: constant,
+ noop: noop,
+ toPath: toPath$1,
+ property: property,
+ propertyOf: propertyOf,
+ matcher: matcher,
+ matches: matcher,
+ times: times,
+ random: random,
+ now: now,
+ escape: _escape,
+ unescape: _unescape,
+ templateSettings: templateSettings,
+ template: template,
+ result: result,
+ uniqueId: uniqueId,
+ chain: chain,
+ iteratee: iteratee,
+ partial: partial,
+ bind: bind,
+ bindAll: bindAll,
+ memoize: memoize,
+ delay: delay,
+ defer: defer,
+ throttle: throttle,
+ debounce: debounce,
+ wrap: wrap,
+ negate: negate,
+ compose: compose,
+ after: after,
+ before: before,
+ once: once,
+ findKey: findKey,
+ findIndex: findIndex,
+ findLastIndex: findLastIndex,
+ sortedIndex: sortedIndex,
+ indexOf: indexOf,
+ lastIndexOf: lastIndexOf,
+ find: find,
+ detect: find,
+ findWhere: findWhere,
+ each: each,
+ forEach: each,
+ map: map,
+ collect: map,
+ reduce: reduce,
+ foldl: reduce,
+ inject: reduce,
+ reduceRight: reduceRight,
+ foldr: reduceRight,
+ filter: filter,
+ select: filter,
+ reject: reject,
+ every: every,
+ all: every,
+ some: some,
+ any: some,
+ contains: contains,
+ includes: contains,
+ include: contains,
+ invoke: invoke,
+ pluck: pluck,
+ where: where,
+ max: max,
+ min: min,
+ shuffle: shuffle,
+ sample: sample,
+ sortBy: sortBy,
+ groupBy: groupBy,
+ indexBy: indexBy,
+ countBy: countBy,
+ partition: partition,
+ toArray: toArray,
+ size: size,
+ pick: pick,
+ omit: omit,
+ first: first,
+ head: first,
+ take: first,
+ initial: initial,
+ last: last,
+ rest: rest,
+ tail: rest,
+ drop: rest,
+ compact: compact,
+ flatten: flatten,
+ without: without,
+ uniq: uniq,
+ unique: uniq,
+ union: union,
+ intersection: intersection,
+ difference: difference,
+ unzip: unzip,
+ transpose: unzip,
+ zip: zip,
+ object: object,
+ range: range,
+ chunk: chunk,
+ mixin: mixin,
+ 'default': _$1
+ };
+
+ // Default Export
+
+ // Add all of the Underscore functions to the wrapper object.
+ var _ = mixin(allExports);
+ // Legacy Node.js API.
+ _._ = _;
+
+ return _;
+
+})));
+//# sourceMappingURL=underscore-umd.js.map
diff --git a/docs/_static/underscore.js b/docs/_static/underscore.js
index 5b55f32..cf177d4 100644
--- a/docs/_static/underscore.js
+++ b/docs/_static/underscore.js
@@ -1,31 +1,6 @@
-// Underscore.js 1.3.1
-// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
-// Underscore is freely distributable under the MIT license.
-// Portions of Underscore are inspired or borrowed from Prototype,
-// Oliver Steele's Functional, and John Resig's Micro-Templating.
-// For all details and documentation:
-// http://documentcloud.github.com/underscore
-(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
-c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,
-h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each=
-b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a==
-null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=
-function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=
-e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
-function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,
-c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};
-b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,
-1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};
-b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};
-b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),
-function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+
-u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=
-function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=
-true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
+!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){
+// Underscore.js 1.13.1
+// https://underscorejs.org
+// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
+// Underscore may be freely distributed under the MIT license.
+var n="1.13.1",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Cn=Ln($n),Kn=Ln(_n($n)),Jn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=/^\s*(\w|\$)+\s*$/;var Zn=0;function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var rr=j((function(n,r){var t=rr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)ur(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var lr=rr(cr,2);function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var Ar=wr(1),xr=wr(-1);function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o=0}var Br=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),_r(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Nr(n,r){return _r(n,Rn(r))}function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1)];var e=er(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=qr,r=ur(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=_r(ur(r,!1,!1),String),e=function(n,t){return!Er(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=ur(r,!0,!0),Sr(n,(function(n){return!Er(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=zn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=zn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return rr(r,n)},negate:fr,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:cr,once:lr,findKey:sr,findIndex:vr,findLastIndex:hr,sortedIndex:yr,indexOf:gr,lastIndexOf:br,find:mr,detect:mr,findWhere:function(n,r){return mr(n,Dn(r))},each:jr,forEach:jr,map:_r,collect:_r,reduce:Ar,foldl:Ar,inject:Ar,reduceRight:xr,foldr:xr,filter:Sr,select:Sr,reject:function(n,r,t){return Sr(n,fr(qn(r)),t)},every:Or,all:Or,some:Mr,any:Mr,contains:Er,includes:Er,include:Er,invoke:Br,pluck:Nr,where:function(n,r){return Sr(n,Dn(r))},max:Ir,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t
+
+
+
+
@@ -144,6 +148,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/example.html b/docs/example.html
new file mode 100644
index 0000000..b77f93f
--- /dev/null
+++ b/docs/example.html
@@ -0,0 +1,188 @@
+
+
+
+
+
+
+
+
+
+
+ example module — PyCTBN 2.0 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/examples.html b/docs/examples.html
index 2755cf0..3f6fa37 100644
--- a/docs/examples.html
+++ b/docs/examples.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -268,6 +272,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/genindex.html b/docs/genindex.html
index bd2996c..e58c172 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -134,14 +138,17 @@
|
+
+ S
| T
| V
+ | W
A
E
- - edges() (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
+
- edges (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
- (PyCTBN.PyCTBN.structure_graph.structure.Structure property)
@@ -297,16 +316,23 @@
- equality_of_cims_of_node() (PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior method)
-
-
+
@@ -325,7 +351,7 @@
- - file_path() (PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter property)
+
- file_path (PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter property)
- filter_cims_with_mask() (PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims method)
@@ -337,6 +363,10 @@
G
- - has_prior_net_structure() (PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath property)
+
- has_prior_net_structure (PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath property)
- HillClimbing (class in PyCTBN.PyCTBN.optimizers.hill_climbing_search)
@@ -414,6 +446,10 @@
J
+
- JsonImporter (class in PyCTBN.PyCTBN.utility.json_importer)
@@ -423,6 +459,8 @@
M
N
+ - NetworkGenerator (class in PyCTBN.PyCTBN.structure_graph.network_generator)
+
- NetworkGraph (class in PyCTBN.PyCTBN.structure_graph.network_graph)
- - nodes() (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
+
- nodes (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
- - nodes_indexes() (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
+
- nodes_indexes (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
- (PyCTBN.PyCTBN.structure_graph.structure.Structure property)
@@ -540,9 +586,9 @@
- - nodes_labels() (PyCTBN.PyCTBN.structure_graph.structure.Structure property)
+
- nodes_labels (PyCTBN.PyCTBN.structure_graph.structure.Structure property)
- - nodes_values() (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
+
- nodes_values (PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph property)
@@ -586,7 +638,7 @@
P
+
+
+W
+
+
@@ -1299,6 +1319,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/index.html b/docs/index.html
index 996979e..8f2e8f1 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -142,18 +146,22 @@
- PyCTBN.PyCTBN.structure_graph package
- Submodules
- PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module
+- PyCTBN.PyCTBN.structure_graph.network_generator module
- PyCTBN.PyCTBN.structure_graph.network_graph module
- PyCTBN.PyCTBN.structure_graph.sample_path module
- PyCTBN.PyCTBN.structure_graph.set_of_cims module
- PyCTBN.PyCTBN.structure_graph.structure module
- PyCTBN.PyCTBN.structure_graph.trajectory module
+- PyCTBN.PyCTBN.structure_graph.trajectory_generator module
- Module contents
- PyCTBN.PyCTBN.utility package
- Submodules
+- PyCTBN.PyCTBN.utility.abstract_exporter module
- PyCTBN.PyCTBN.utility.abstract_importer module
- PyCTBN.PyCTBN.utility.cache module
+- PyCTBN.PyCTBN.utility.json_exporter module
- PyCTBN.PyCTBN.utility.json_importer module
- PyCTBN.PyCTBN.utility.sample_importer module
- Module contents
@@ -218,6 +226,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/modules.html b/docs/modules.html
index 2540d43..1f64d19 100644
--- a/docs/modules.html
+++ b/docs/modules.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -116,59 +120,28 @@
PyCTBN¶
-- PyCTBN.PyCTBN package
-- Subpackages
-- PyCTBN.PyCTBN.estimators package
-- Submodules
-- PyCTBN.PyCTBN.estimators.fam_score_calculator module
-- PyCTBN.PyCTBN.estimators.parameters_estimator module
-- PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator module
-- PyCTBN.PyCTBN.estimators.structure_estimator module
-- PyCTBN.PyCTBN.estimators.structure_score_based_estimator module
-- Module contents
-
-
-- PyCTBN.PyCTBN.optimizers package
-
-- PyCTBN.PyCTBN.structure_graph package
-- Submodules
-- PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module
-- PyCTBN.PyCTBN.structure_graph.network_graph module
-- PyCTBN.PyCTBN.structure_graph.sample_path module
-- PyCTBN.PyCTBN.structure_graph.set_of_cims module
-- PyCTBN.PyCTBN.structure_graph.structure module
-- PyCTBN.PyCTBN.structure_graph.trajectory module
-- Module contents
-
-
-- PyCTBN.PyCTBN.utility package
@@ -201,6 +174,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/objects.inv b/docs/objects.inv
index 66df86d..bb95ee3 100644
Binary files a/docs/objects.inv and b/docs/objects.inv differ
diff --git a/docs/py-modindex.html b/docs/py-modindex.html
index d729367..d191c8c 100644
--- a/docs/py-modindex.html
+++ b/docs/py-modindex.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -119,11 +123,20 @@
Python Module Index
+
+ e
+
+
+
+ example
+
+
p
@@ -202,6 +215,11 @@
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix
+
+
+
+ PyCTBN.PyCTBN.structure_graph.network_generator
+
@@ -230,72 +248,67 @@
- PyCTBN.PyCTBN.utility
-
-
-
-
- PyCTBN.PyCTBN.utility.abstract_importer
+ PyCTBN.PyCTBN.structure_graph.trajectory_generator
- PyCTBN.PyCTBN.utility.cache
+ PyCTBN.PyCTBN.utility
- PyCTBN.PyCTBN.utility.json_importer
+ PyCTBN.PyCTBN.utility.abstract_exporter
- PyCTBN.PyCTBN.utility.sample_importer
+ PyCTBN.PyCTBN.utility.abstract_importer
- PyCTBN.tests
+ PyCTBN.PyCTBN.utility.cache
- PyCTBN.tests.estimators
+ PyCTBN.PyCTBN.utility.json_exporter
- PyCTBN.tests.estimators.test_parameters_estimator
+ PyCTBN.PyCTBN.utility.json_importer
- PyCTBN.tests.estimators.test_structure_constraint_based_estimator
+ PyCTBN.PyCTBN.utility.sample_importer
- PyCTBN.tests.estimators.test_structure_estimator
+ PyCTBN.tests
- PyCTBN.tests.estimators.test_structure_score_based_estimator
+ PyCTBN.tests.estimators
- PyCTBN.tests.optimizers
+ PyCTBN.tests.estimators.test_parameters_estimator
- PyCTBN.tests.optimizers.test_hill_climbing_search
+ PyCTBN.tests.estimators.test_structure_estimator
- PyCTBN.tests.optimizers.test_tabu_search
+ PyCTBN.tests.optimizers
@@ -382,6 +395,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/search.html b/docs/search.html
index 21fd6c9..32554f6 100644
--- a/docs/search.html
+++ b/docs/search.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -153,6 +157,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-
diff --git a/docs/searchindex.js b/docs/searchindex.js
index 22a6a83..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","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
+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 8f74cf7..1e64098 100644
--- a/docs/setup.html
+++ b/docs/setup.html
@@ -19,6 +19,10 @@
+
+
+
+
@@ -144,6 +148,9 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
+
+
-