diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/PyCTBN/classes/abstract_importer.py b/PyCTBN/classes/abstract_importer.py index 513a6e7..c7b7503 100644 --- a/PyCTBN/classes/abstract_importer.py +++ b/PyCTBN/classes/abstract_importer.py @@ -2,39 +2,43 @@ import typing from abc import ABC, abstractmethod +import numpy as np import pandas as pd class AbstractImporter(ABC): """Abstract class that exposes all the necessary methods to process the trajectories and the net structure. - :param file_path: the file path + :param file_path: the file path, or dataset name if you import already processed data :type file_path: str - :_concatenated_samples: Dataframe containing the concatenation of all the processed trajectories - :_df_structure: Dataframe containing the structure of the network (edges) - :_df_variables: Dataframe containing the nodes cardinalities - :_sorter: A list containing the columns header (excluding the time column) of the ``_concatenated_samples`` + :param concatenated_samples: Dataframe or numpy array containing the concatenation of all the processed trajectories + :type concatenated_samples: typing.Union[pandas.DataFrame, numpy.ndarray] + :param variables: Dataframe containing the nodes labels and cardinalities + :type variables: pandas.DataFrame + :prior_net_structure: Dataframe containing the structure of the network (edges) + :type prior_net_structure: pandas.DataFrame + :_sorter: A list containing the variables labels in the SAME order as the columns in ``concatenated_samples`` .. warning:: - The class members ``_df_variables`` and ``_df_structure`` HAVE to be properly constructed + The parameters ``variables`` and ``prior_net_structure`` HAVE to be properly constructed as Pandas Dataframes with the following structure: Header of _df_structure = [From_Node | To_Node] Header of _df_variables = [Variable_Label | Variable_Cardinality] + See the tutorial on how to construct a correct ``concatenated_samples`` Dataframe/ndarray. - .. note:: - If you don't have prior network structure just leave ``_df_structure`` set to None. .. note:: See :class:``JsonImporter`` for an example implementation """ - def __init__(self, file_path: str): + def __init__(self, file_path: str = None, concatenated_samples: typing.Union[pd.DataFrame, np.ndarray] = None, + variables: pd.DataFrame = None, prior_net_structure: pd.DataFrame = None): """Constructor """ self._file_path = file_path - self._df_variables = None - self._df_structure = None - self._concatenated_samples = None + self._concatenated_samples = concatenated_samples + self._df_variables = variables + self._df_structure = prior_net_structure self._sorter = None super().__init__() @@ -104,21 +108,27 @@ class AbstractImporter(ABC): complete_header.extend(shifted_cols_header) self._concatenated_samples = self._concatenated_samples[complete_header] - def build_list_of_samples_array(self, data_frame: pd.DataFrame) -> typing.List: - """Builds a List containing the columns of data_frame and converts them to a numpy array. + def build_list_of_samples_array(self, concatenated_sample: typing.Union[pd.DataFrame, np.ndarray]) -> typing.List: + """Builds a List containing the the delta times numpy array, and the complete transitions matrix - :param data_frame: the dataframe from which the columns have to be extracted and converted - :type data_frame: pandas.Dataframe + :param concatenated_sample: the dataframe/array from which the time, and transitions matrix have to be extracted + and converted + :type concatenated_sample: typing.Union[pandas.Dataframe, numpy.ndarray] :return: the resulting list of numpy arrays :rtype: List """ - columns_list = [data_frame[column].to_numpy() for column in data_frame] + if isinstance(concatenated_sample, pd.DataFrame): + concatenated_array = concatenated_sample.to_numpy() + columns_list = [concatenated_array[:, 0], concatenated_array[:, 1:].astype(int)] + else: + columns_list = [concatenated_sample[:, 0], concatenated_sample[:, 1:].astype(int)] return columns_list def clear_concatenated_frame(self) -> None: """Removes all values in the dataframe concatenated_samples. """ - self._concatenated_samples = self._concatenated_samples.iloc[0:0] + if isinstance(self._concatenated_samples, pd.DataFrame): + self._concatenated_samples = self._concatenated_samples.iloc[0:0] @abstractmethod def dataset_id(self) -> object: diff --git a/PyCTBN/classes/sample_path.py b/PyCTBN/classes/sample_path.py index 93d1b72..f9b9b6c 100644 --- a/PyCTBN/classes/sample_path.py +++ b/PyCTBN/classes/sample_path.py @@ -1,4 +1,7 @@ +import numpy as np +import pandas as pd + from .abstract_importer import AbstractImporter from .structure import Structure from .trajectory import Trajectory @@ -19,10 +22,16 @@ class SamplePath(object): """Constructor Method """ self._importer = importer - if (self._importer._df_variables is None or self._importer._concatenated_samples is None): + if self._importer._df_variables is None or self._importer._concatenated_samples is None: raise RuntimeError('The importer object has to contain the all processed data!') - if(self._importer._df_variables.empty or self._importer._concatenated_samples.empty): + if self._importer._df_variables.empty: raise RuntimeError('The importer object has to contain the all processed data!') + if isinstance(self._importer._concatenated_samples, pd.DataFrame): + if self._importer._concatenated_samples.empty: + raise RuntimeError('The importer object has to contain the all processed data!') + if isinstance(self._importer._concatenated_samples, np.ndarray): + if self._importer._concatenated_samples.size == 0: + raise RuntimeError('The importer object has to contain the all processed data!') self._trajectories = None self._structure = None self._total_variables_count = None diff --git a/PyCTBN/classes/structure_estimator.py b/PyCTBN/classes/structure_estimator.py index ac315f6..b28c95d 100644 --- a/PyCTBN/classes/structure_estimator.py +++ b/PyCTBN/classes/structure_estimator.py @@ -259,6 +259,7 @@ class StructureEstimator(object): graph_to_draw = nx.DiGraph() spurious_edges = self.spurious_edges() non_spurious_edges = list(set(self._complete_graph.edges) - set(spurious_edges)) + print(non_spurious_edges) edges_colors = ['red' if edge in spurious_edges else 'black' for edge in self._complete_graph.edges] graph_to_draw.add_edges_from(spurious_edges) graph_to_draw.add_edges_from(non_spurious_edges) @@ -270,7 +271,7 @@ class StructureEstimator(object): 'linewidths':2, "with_labels":True, "font_size":13, - 'connectionstyle': 'arc3, rad = 0.', + 'connectionstyle': 'arc3, rad = 0.1', "arrowsize": 15, "arrowstyle": '<|-', "width": 1, diff --git a/PyCTBN/classes/trajectory.py b/PyCTBN/classes/trajectory.py index 6cb41f4..0a0a861 100644 --- a/PyCTBN/classes/trajectory.py +++ b/PyCTBN/classes/trajectory.py @@ -19,11 +19,9 @@ class Trajectory(object): def __init__(self, list_of_columns: typing.List, original_cols_number: int): """Constructor Method """ - if type(list_of_columns[0][0]) != np.float64: - raise TypeError('The first array in the list has to be Times') + self._times = list_of_columns[0] + self._actual_trajectory = list_of_columns[1] self._original_cols_number = original_cols_number - self._actual_trajectory = np.array(list_of_columns[1:], dtype=np.int).T - self._times = np.array(list_of_columns[0], dtype=np.float) @property def trajectory(self) -> np.ndarray: diff --git a/docs/classes.html b/docs/classes.html index 5f7476b..7b3d260 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -134,36 +134,31 @@

classes.abstract_importer module

-class classes.abstract_importer.AbstractImporter(file_path: str)
+class classes.abstract_importer.AbstractImporter(file_path: str = None, concatenated_samples: Union[pandas.core.frame.DataFrame, numpy.ndarray] = None, variables: pandas.core.frame.DataFrame = None, prior_net_structure: pandas.core.frame.DataFrame = None)

Bases: abc.ABC

Abstract class that exposes all the necessary methods to process the trajectories and the net structure.

Parameters
-

file_path (str) – the file path

-
-
_concatenated_samples
-

Dataframe containing the concatenation of all the processed trajectories

-
-
_df_structure
-

Dataframe containing the structure of the network (edges)

+
    +
  • file_path (str) – the file path, or dataset name if you import already processed data

  • +
  • concatenated_samples (typing.Union[pandas.DataFrame, numpy.ndarray]) – Dataframe or numpy array containing the concatenation of all the processed trajectories

  • +
  • variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities

  • +
-
_df_variables
-

Dataframe containing the nodes cardinalities

+
Prior_net_structure
+

Dataframe containing the structure of the network (edges)

_sorter
-

A list containing the columns header (excluding the time column) of the _concatenated_samples

+

A list containing the variables labels in the SAME order as the columns in concatenated_samples

Warning

-

The class members _df_variables and _df_structure HAVE to be properly constructed +

The parameters variables and prior_net_structure HAVE to be properly constructed as Pandas Dataframes with the following structure: Header of _df_structure = [From_Node | To_Node] -Header of _df_variables = [Variable_Label | Variable_Cardinality]

-
-
-

Note

-

If you don’t have prior network structure just leave _df_structure set to None.

+Header of _df_variables = [Variable_Label | Variable_Cardinality] +See the tutorial on how to construct a correct concatenated_samples Dataframe/ndarray.

Note

@@ -171,11 +166,12 @@ Header of _df_variables = [Variable_Label | Variable_Cardinality]

-build_list_of_samples_array(data_frame: pandas.core.frame.DataFrame) → List
-

Builds a List containing the columns of data_frame and converts them to a numpy array.

+build_list_of_samples_array(concatenated_sample: Union[pandas.core.frame.DataFrame, numpy.ndarray]) → List +

Builds a List containing the the delta times numpy array, and the complete transitions matrix

Parameters
-

data_frame (pandas.Dataframe) – the dataframe from which the columns have to be extracted and converted

+

concatenated_sample (typing.Union[pandas.Dataframe, numpy.ndarray]) – the dataframe/array from which the time, and transitions matrix have to be extracted +and converted

Returns

the resulting list of numpy arrays

@@ -981,6 +977,11 @@ contain the mentioned data.

Clears all the unused dataframes in _importer Object

+
+
+property has_prior_net_structure
+
+
property structure
@@ -1228,7 +1229,7 @@ The class member _t
adjacency_matrix() → numpy.ndarray
-

Converts the estimated structrure _complete_graph to a boolean adjacency matrix representation.

+

Converts the estimated structure _complete_graph to a boolean adjacency matrix representation.

Returns

The adjacency matrix of the graph _complete_graph

@@ -1343,6 +1344,13 @@ it is performed also the chi_test.

+
+
+save_plot_estimated_structure_graph() → None
+

Plot the estimated structure in a graphical model style. +Spurious edges are colored in red.

+
+
save_results() → None
@@ -1350,6 +1358,23 @@ it is performed also the chi_test.

The file is named as the input dataset but the results_ word is appended to the results file.

+
+
+spurious_edges() → List
+
+
Return the spurious edges present in the estimated structure, if a prior net structure is present in

_sample_path.structure.

+
+
+
+
Returns
+

A list containing the spurious edges

+
+
Return type
+

List

+
+
+
+
diff --git a/docs/genindex.html b/docs/genindex.html index e17f709..6c1d048 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -134,6 +134,7 @@ | E | F | G + | H | I | J | M @@ -406,6 +407,14 @@ +

H

+ + +
+

I

    @@ -547,6 +556,8 @@
      +
    • spurious_edges() (classes.structure_estimator.StructureEstimator method) +
    • state_residence_times() (classes.conditional_intensity_matrix.ConditionalIntensityMatrix property)
    • state_transition_matrix() (classes.conditional_intensity_matrix.ConditionalIntensityMatrix property) diff --git a/docs/objects.inv b/docs/objects.inv index 973ae93..d3c3f62 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/searchindex.js b/docs/searchindex.js index 8aedd55..e113010 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["classes","examples","index","modules"],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:["classes.rst","examples.rst","index.rst","modules.rst"],objects:{"":{classes:[0,0,0,"-"]},"classes.abstract_importer":{AbstractImporter:[0,1,1,""]},"classes.abstract_importer.AbstractImporter":{build_list_of_samples_array:[0,2,1,""],build_sorter:[0,2,1,""],clear_concatenated_frame:[0,2,1,""],compute_row_delta_in_all_samples_frames:[0,2,1,""],compute_row_delta_sigle_samples_frame:[0,2,1,""],concatenated_samples:[0,2,1,""],dataset_id:[0,2,1,""],file_path:[0,2,1,""],sorter:[0,2,1,""],structure:[0,2,1,""],variables:[0,2,1,""]},"classes.cache":{Cache:[0,1,1,""]},"classes.cache.Cache":{clear:[0,2,1,""],find:[0,2,1,""],put:[0,2,1,""]},"classes.conditional_intensity_matrix":{ConditionalIntensityMatrix:[0,1,1,""]},"classes.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[0,2,1,""],compute_cim_coefficients:[0,2,1,""],state_residence_times:[0,2,1,""],state_transition_matrix:[0,2,1,""]},"classes.json_importer":{JsonImporter:[0,1,1,""]},"classes.json_importer.JsonImporter":{build_sorter:[0,2,1,""],clear_data_frame_list:[0,2,1,""],dataset_id:[0,2,1,""],import_data:[0,2,1,""],import_sampled_cims:[0,2,1,""],import_structure:[0,2,1,""],import_trajectories:[0,2,1,""],import_variables:[0,2,1,""],normalize_trajectories:[0,2,1,""],one_level_normalizing:[0,2,1,""],read_json_file:[0,2,1,""]},"classes.network_graph":{NetworkGraph:[0,1,1,""]},"classes.network_graph.NetworkGraph":{add_edges:[0,2,1,""],add_nodes:[0,2,1,""],build_p_comb_structure_for_a_node:[0,2,1,""],build_time_columns_filtering_for_a_node:[0,2,1,""],build_time_scalar_indexing_structure_for_a_node:[0,2,1,""],build_transition_filtering_for_a_node:[0,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[0,2,1,""],clear_indexing_filtering_structures:[0,2,1,""],edges:[0,2,1,""],fast_init:[0,2,1,""],get_node_indx:[0,2,1,""],get_ordered_by_indx_set_of_parents:[0,2,1,""],get_parents_by_id:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_values:[0,2,1,""],p_combs:[0,2,1,""],remove_node:[0,2,1,""],time_filtering:[0,2,1,""],time_scalar_indexing_strucure:[0,2,1,""],transition_filtering:[0,2,1,""],transition_scalar_indexing_structure:[0,2,1,""]},"classes.parameters_estimator":{ParametersEstimator:[0,1,1,""]},"classes.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[0,2,1,""],compute_state_res_time_for_node:[0,2,1,""],compute_state_transitions_for_a_node:[0,2,1,""],fast_init:[0,2,1,""]},"classes.sample_path":{SamplePath:[0,1,1,""]},"classes.sample_path.SamplePath":{build_structure:[0,2,1,""],build_trajectories:[0,2,1,""],structure:[0,2,1,""],total_variables_count:[0,2,1,""],trajectories:[0,2,1,""]},"classes.set_of_cims":{SetOfCims:[0,1,1,""]},"classes.set_of_cims.SetOfCims":{actual_cims:[0,2,1,""],build_cims:[0,2,1,""],build_times_and_transitions_structures:[0,2,1,""],filter_cims_with_mask:[0,2,1,""],get_cims_number:[0,2,1,""],p_combs:[0,2,1,""]},"classes.structure":{Structure:[0,1,1,""]},"classes.structure.Structure":{edges:[0,2,1,""],get_node_id:[0,2,1,""],get_node_indx:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_labels:[0,2,1,""],nodes_values:[0,2,1,""],remove_node:[0,2,1,""],total_variables_number:[0,2,1,""]},"classes.structure_estimator":{StructureEstimator:[0,1,1,""]},"classes.structure_estimator.StructureEstimator":{adjacency_matrix:[0,2,1,""],build_complete_graph:[0,2,1,""],complete_test:[0,2,1,""],ctpc_algorithm:[0,2,1,""],generate_possible_sub_sets_of_size:[0,2,1,""],independence_test:[0,2,1,""],one_iteration_of_CTPC_algorithm:[0,2,1,""],save_results:[0,2,1,""]},"classes.trajectory":{Trajectory:[0,1,1,""]},"classes.trajectory.Trajectory":{complete_trajectory:[0,2,1,""],size:[0,2,1,""],times:[0,2,1,""],trajectory:[0,2,1,""]},classes:{abstract_importer:[0,0,0,"-"],cache:[0,0,0,"-"],conditional_intensity_matrix:[0,0,0,"-"],json_importer:[0,0,0,"-"],network_graph:[0,0,0,"-"],parameters_estimator:[0,0,0,"-"],sample_path:[0,0,0,"-"],set_of_cims:[0,0,0,"-"],structure:[0,0,0,"-"],structure_estimator:[0,0,0,"-"],trajectory:[0,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":[0,1],"boolean":0,"class":[1,2],"float":0,"import":[0,2],"int":0,"null":0,"return":[0,1],"static":0,"super":1,"true":[0,1],"var":1,HAS:0,Has:0,NOT:0,The:[0,1],Use:1,__init__:1,_actual_cach:0,_actual_cim:0,_actual_trajectori:0,_aggregated_info_about_nodes_par:0,_array_indx:0,_cach:0,_cim:0,_complete_graph:0,_concatenated_sampl:0,_df_samples_list:[0,1],_df_structur:0,_df_variabl:[0,1],_file_path:1,_graph:[0,1],_import:0,_list_of_sets_of_par:0,_net_graph:0,_node:0,_node_id:0,_nodes_indx:0,_nodes_v:0,_p_combs_structur:0,_raw_data:0,_sample_path:0,_single_set_of_cim:0,_sorter:[0,1],_state_residence_tim:0,_structur:0,_structure_label:0,_time:0,_time_filt:0,_time_scalar_indexing_structur:0,_total_variables_count:0,_total_variables_numb:0,_trajectori:0,_transition_filt:0,_transition_matric:0,_transition_scalar_indexing_structur:0,_variables_label:0,abc:0,about:0,abstract_import:[2,3],abstractimport:[0,1],act:0,actual:0,actual_cim:[0,1],add:0,add_edg:0,add_nod:0,added:0,addit:0,adjac:[0,1],adjacency_matrix:[0,1],after:0,aggreg:0,algorithm:[0,1],all:[0,1],alreadi:1,also:0,anoth:0,append:0,arc:0,arrai:[0,1],axi:1,base:0,belong:0,between:0,bool:0,both:0,bound:0,build:[0,1],build_cim:0,build_complete_graph:0,build_list_of_samples_arrai:0,build_p_comb_structure_for_a_nod:0,build_sort:[0,1],build_structur:[0,1],build_time_columns_filtering_for_a_nod:0,build_time_scalar_indexing_structure_for_a_nod:0,build_times_and_transitions_structur:0,build_trajectori:[0,1],build_transition_filtering_for_a_nod:0,build_transition_scalar_indexing_structure_for_a_nod:0,built:0,cach:[2,3],call:[0,1],cardin:0,cardinalit:0,caridin:0,caridinalit:0,chang:0,chi:0,chi_test:0,chi_test_alfa:0,child:0,child_states_numb:0,cim1:0,cim2:0,cim:[0,1],cims_kei:0,clear:0,clear_concatenated_fram:0,clear_data_frame_list:0,clear_indexing_filtering_structur:0,coeffici:0,col:0,cols_filt:0,column:[0,1],columns_head:0,comb:0,combin:0,combinatori:0,common:0,complet:0,complete_test:0,complete_trajectori:0,comput:[0,1],compute_cim_coeffici:0,compute_parameters_for_nod:[0,1],compute_row_delta_in_all_samples_fram:[0,1],compute_row_delta_sigle_samples_fram:0,compute_state_res_time_for_nod:0,compute_state_transitions_for_a_nod:0,concatanated_sampl:0,concaten:0,concatenated_sampl:0,condit:0,conditional_intensity_matrix:[2,3],conditionalintensitymatrix:0,consid:0,construct:[0,1],conta:0,contain:0,content:[2,3],convert:0,copi:0,core:0,correct:0,count:0,creat:[0,1],csv:1,csvimport:1,ctpc:[0,1],ctpc_algorithm:[0,1],current:0,cut:0,dafram:0,data:[0,2],data_fram:0,datafram:[0,1],dataset:0,dataset_id:[0,1],datfram:0,def:1,definit:0,delta:0,demonstr:1,desir:0,df_samples_list:0,dict:[0,1],dictionari:0,differ:0,digraph:0,dimens:0,dir:1,direct:0,doc:0,don:0,doubl:0,download:1,drop:1,duplic:0,dyn:1,each:0,edg:[0,1],edges_list:0,end:0,entir:0,equal:0,est:1,estim:[0,2],everi:0,exam:1,exampl:[0,2],exclud:0,exctract:0,exp_test_alfa:0,exponenti:0,expos:0,extend:1,extens:0,extract:0,fals:0,fast_init:[0,1],file:[0,1],file_path:[0,1],filepath:0,fill:[0,1],filter:0,filter_cims_with_mask:0,find:0,first:[0,1],follow:0,form:0,format:1,found:0,frame:0,from:[0,1],from_nod:0,gener:0,generate_possible_sub_sets_of_s:0,get_cims_numb:0,get_node_id:0,get_node_indx:0,get_ordered_by_indx_set_of_par:0,get_parents_by_id:0,get_positional_node_indx:0,get_states_numb:0,given:0,glob:1,graph:[0,1],graph_struct:0,grid:0,grpah:1,has:[0,1],have:0,header:0,hold:0,hypothesi:0,identifi:0,iff:0,implement:[0,2],import_data:[0,1],import_sampled_cim:0,import_structur:0,import_trajectori:0,import_vari:[0,1],independ:0,independence_test:0,index:[0,1,2],indic:0,indx:0,info:[0,1],inform:0,init:1,initi:[0,1],inplac:1,input:0,insid:1,instal:2,interest:0,intes:0,iter:0,join:1,json:[0,1],json_import:[2,3],jsonarrai:0,jsonimport:[0,1],just:0,keep:0,kei:0,label:0,leav:0,level:0,list:[0,1],list_of_column:0,list_of_edg:0,list_of_nod:0,load:0,loop:0,main:1,mask:0,mask_arr:0,matric:0,matrix:[0,1],member:0,mention:0,merg:0,method:0,modul:[2,3],multipl:0,name:[0,1],ndarrai:0,necessari:0,nest:0,net:[0,1],net_graph:0,network:0,network_graph:[2,3],networkgraph:[0,1],networkx:0,node:[0,1],node_id:0,node_index:0,node_indx:0,node_st:0,node_states_numb:0,nodes_index:0,nodes_indexes_arr:0,nodes_label:0,nodes_labels_list:0,nodes_numb:0,nodes_vals_arr:0,nodes_valu:[0,1],none:[0,1],normal:0,normalize_trajectori:0,number:0,numpi:0,obj:1,object:[0,1],one:0,one_iteration_of_ctpc_algorithm:0,one_level_norm:0,onli:0,origin:0,original_cols_numb:0,otherwis:0,out:0,outer:[0,1],over:0,own:2,p_comb:0,p_indx:0,packag:[2,3],page:2,panda:[0,1],param:0,paramet:[0,2],parameters_estim:[2,3],parametersestim:[0,1],parent:0,parent_label:0,parent_set:0,parents_cardin:0,parents_comb:0,parents_index:0,parents_label:0,parents_states_numb:0,parents_v:0,parents_valu:0,particular:0,pass:1,path:[0,1],peest:1,perform:0,pip:1,place:0,posit:0,possibl:0,prepar:0,present:0,print:1,prior:[0,1],process:0,properli:0,properti:0,put:0,pyctbn:1,q_xx:0,raw:0,raw_data:0,read:[0,1],read_csv:1,read_csv_fil:1,read_fil:1,read_json_fil:0,real:[0,1],refer:0,reject:0,rel:0,relat:0,releas:1,remain:0,remov:0,remove_nod:0,repres:0,represent:0,res:0,resid:0,result:[0,1],results_:0,rtype:0,same:0,sampl:[0,1],sample_fram:[0,1],sample_path:[2,3],samplepath:[0,1],samples_label:0,save:[0,1],save_result:[0,1],scalar_index:0,scalar_indexes_struct:0,se1:1,search:2,see:0,select:1,self:[0,1],sep_set:0,set:0,set_of_cim:[2,3],setofcim:[0,1],shift:0,shifted_cols_head:0,signific:0,simbol:0,simpl:1,simpli:1,sinc:0,size:0,socim:0,sofc1:1,sorter:0,specif:1,start:0,state:0,state_res_tim:0,state_residence_tim:0,state_transition_matrix:0,str:[0,1],string:0,structrur:0,structur:[2,3],structure_estim:[2,3],structure_estimation_exampl:1,structure_label:0,structureestim:[0,1],structut:0,submodul:[2,3],subset:0,symbol:0,synthet:0,take:1,tar:1,task:0,ternari:1,test:0,test_child:0,test_par:0,tha:0,them:0,thi:[0,1],three:1,time:[0,1],time_filt:0,time_kei:0,time_scalar_indexing_strucur:0,timestamp:0,to_nod:0,tot_vars_count:0,total:0,total_variables_count:0,total_variables_numb:0,traj:0,trajectori:[1,2,3],trajectories_kei:0,trajectri:1,transit:0,transition_filt:0,transition_matric:0,transition_scalar_indexing_structur:0,tri:0,tupl:0,two:0,type:[0,1],uniqu:0,unus:0,usag:2,use:1,used:0,using:0,valu:[0,1],values_list:1,var_id:0,variabl:[0,1],variable_cardin:0,variable_label:0,variables_kei:0,variables_label:0,vector:0,want:1,where:0,which:0,whl:1,without:0,word:0,you:[0,1],your:2},titles:["classes package","Examples","Welcome to PyCTBN\u2019s documentation!","classes"],titleterms:{"class":[0,3],"import":1,abstract_import:0,cach:0,conditional_intensity_matrix:0,content:0,data:1,document:2,estim:1,exampl:1,implement:1,indic:2,instal:1,json_import:0,modul:0,network_graph:0,own:1,packag:0,paramet:1,parameters_estim:0,pyctbn:2,sample_path:0,set_of_cim:0,structur:[0,1],structure_estim:0,submodul:0,tabl:2,trajectori:0,usag:1,welcom:2,your:1}}) \ No newline at end of file +Search.setIndex({docnames:["classes","examples","index","modules"],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:["classes.rst","examples.rst","index.rst","modules.rst"],objects:{"":{classes:[0,0,0,"-"]},"classes.abstract_importer":{AbstractImporter:[0,1,1,""]},"classes.abstract_importer.AbstractImporter":{build_list_of_samples_array:[0,2,1,""],build_sorter:[0,2,1,""],clear_concatenated_frame:[0,2,1,""],compute_row_delta_in_all_samples_frames:[0,2,1,""],compute_row_delta_sigle_samples_frame:[0,2,1,""],concatenated_samples:[0,2,1,""],dataset_id:[0,2,1,""],file_path:[0,2,1,""],sorter:[0,2,1,""],structure:[0,2,1,""],variables:[0,2,1,""]},"classes.cache":{Cache:[0,1,1,""]},"classes.cache.Cache":{clear:[0,2,1,""],find:[0,2,1,""],put:[0,2,1,""]},"classes.conditional_intensity_matrix":{ConditionalIntensityMatrix:[0,1,1,""]},"classes.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[0,2,1,""],compute_cim_coefficients:[0,2,1,""],state_residence_times:[0,2,1,""],state_transition_matrix:[0,2,1,""]},"classes.json_importer":{JsonImporter:[0,1,1,""]},"classes.json_importer.JsonImporter":{build_sorter:[0,2,1,""],clear_data_frame_list:[0,2,1,""],dataset_id:[0,2,1,""],import_data:[0,2,1,""],import_sampled_cims:[0,2,1,""],import_structure:[0,2,1,""],import_trajectories:[0,2,1,""],import_variables:[0,2,1,""],normalize_trajectories:[0,2,1,""],one_level_normalizing:[0,2,1,""],read_json_file:[0,2,1,""]},"classes.network_graph":{NetworkGraph:[0,1,1,""]},"classes.network_graph.NetworkGraph":{add_edges:[0,2,1,""],add_nodes:[0,2,1,""],build_p_comb_structure_for_a_node:[0,2,1,""],build_time_columns_filtering_for_a_node:[0,2,1,""],build_time_scalar_indexing_structure_for_a_node:[0,2,1,""],build_transition_filtering_for_a_node:[0,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[0,2,1,""],clear_indexing_filtering_structures:[0,2,1,""],edges:[0,2,1,""],fast_init:[0,2,1,""],get_node_indx:[0,2,1,""],get_ordered_by_indx_set_of_parents:[0,2,1,""],get_parents_by_id:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_values:[0,2,1,""],p_combs:[0,2,1,""],remove_node:[0,2,1,""],time_filtering:[0,2,1,""],time_scalar_indexing_strucure:[0,2,1,""],transition_filtering:[0,2,1,""],transition_scalar_indexing_structure:[0,2,1,""]},"classes.parameters_estimator":{ParametersEstimator:[0,1,1,""]},"classes.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[0,2,1,""],compute_state_res_time_for_node:[0,2,1,""],compute_state_transitions_for_a_node:[0,2,1,""],fast_init:[0,2,1,""]},"classes.sample_path":{SamplePath:[0,1,1,""]},"classes.sample_path.SamplePath":{build_structure:[0,2,1,""],build_trajectories:[0,2,1,""],has_prior_net_structure:[0,2,1,""],structure:[0,2,1,""],total_variables_count:[0,2,1,""],trajectories:[0,2,1,""]},"classes.set_of_cims":{SetOfCims:[0,1,1,""]},"classes.set_of_cims.SetOfCims":{actual_cims:[0,2,1,""],build_cims:[0,2,1,""],build_times_and_transitions_structures:[0,2,1,""],filter_cims_with_mask:[0,2,1,""],get_cims_number:[0,2,1,""],p_combs:[0,2,1,""]},"classes.structure":{Structure:[0,1,1,""]},"classes.structure.Structure":{edges:[0,2,1,""],get_node_id:[0,2,1,""],get_node_indx:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_labels:[0,2,1,""],nodes_values:[0,2,1,""],remove_node:[0,2,1,""],total_variables_number:[0,2,1,""]},"classes.structure_estimator":{StructureEstimator:[0,1,1,""]},"classes.structure_estimator.StructureEstimator":{adjacency_matrix:[0,2,1,""],build_complete_graph:[0,2,1,""],complete_test:[0,2,1,""],ctpc_algorithm:[0,2,1,""],generate_possible_sub_sets_of_size:[0,2,1,""],independence_test:[0,2,1,""],one_iteration_of_CTPC_algorithm:[0,2,1,""],save_plot_estimated_structure_graph:[0,2,1,""],save_results:[0,2,1,""],spurious_edges:[0,2,1,""]},"classes.trajectory":{Trajectory:[0,1,1,""]},"classes.trajectory.Trajectory":{complete_trajectory:[0,2,1,""],size:[0,2,1,""],times:[0,2,1,""],trajectory:[0,2,1,""]},classes:{abstract_importer:[0,0,0,"-"],cache:[0,0,0,"-"],conditional_intensity_matrix:[0,0,0,"-"],json_importer:[0,0,0,"-"],network_graph:[0,0,0,"-"],parameters_estimator:[0,0,0,"-"],sample_path:[0,0,0,"-"],set_of_cims:[0,0,0,"-"],structure:[0,0,0,"-"],structure_estimator:[0,0,0,"-"],trajectory:[0,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":[0,1],"boolean":0,"class":[1,2],"float":0,"import":[0,2],"int":0,"null":0,"return":[0,1],"static":0,"super":1,"true":[0,1],"var":1,HAS:0,Has:0,NOT:0,The:[0,1],Use:1,__init__:1,_actual_cach:0,_actual_cim:0,_actual_trajectori:0,_aggregated_info_about_nodes_par:0,_array_indx:0,_cach:0,_cim:0,_complete_graph:0,_df_samples_list:[0,1],_df_structur:0,_df_variabl:[0,1],_file_path:1,_graph:[0,1],_import:0,_list_of_sets_of_par:0,_net_graph:0,_node:0,_node_id:0,_nodes_indx:0,_nodes_v:0,_p_combs_structur:0,_raw_data:0,_sample_path:0,_single_set_of_cim:0,_sorter:[0,1],_state_residence_tim:0,_structur:0,_structure_label:0,_time:0,_time_filt:0,_time_scalar_indexing_structur:0,_total_variables_count:0,_total_variables_numb:0,_trajectori:0,_transition_filt:0,_transition_matric:0,_transition_scalar_indexing_structur:0,_variables_label:0,abc:0,about:0,abstract_import:[2,3],abstractimport:[0,1],act:0,actual:0,actual_cim:[0,1],add:0,add_edg:0,add_nod:0,added:0,addit:0,adjac:[0,1],adjacency_matrix:[0,1],after:0,aggreg:0,algorithm:[0,1],all:[0,1],alreadi:[0,1],also:0,anoth:0,append:0,arc:0,arrai:[0,1],axi:1,base:0,belong:0,between:0,bool:0,both:0,bound:0,build:[0,1],build_cim:0,build_complete_graph:0,build_list_of_samples_arrai:0,build_p_comb_structure_for_a_nod:0,build_sort:[0,1],build_structur:[0,1],build_time_columns_filtering_for_a_nod:0,build_time_scalar_indexing_structure_for_a_nod:0,build_times_and_transitions_structur:0,build_trajectori:[0,1],build_transition_filtering_for_a_nod:0,build_transition_scalar_indexing_structure_for_a_nod:0,built:0,cach:[2,3],call:[0,1],cardin:0,cardinalit:0,caridin:0,caridinalit:0,chang:0,chi:0,chi_test:0,chi_test_alfa:0,child:0,child_states_numb:0,cim1:0,cim2:0,cim:[0,1],cims_kei:0,clear:0,clear_concatenated_fram:0,clear_data_frame_list:0,clear_indexing_filtering_structur:0,coeffici:0,col:0,color:0,cols_filt:0,column:[0,1],columns_head:0,comb:0,combin:0,combinatori:0,common:0,complet:0,complete_test:0,complete_trajectori:0,comput:[0,1],compute_cim_coeffici:0,compute_parameters_for_nod:[0,1],compute_row_delta_in_all_samples_fram:[0,1],compute_row_delta_sigle_samples_fram:0,compute_state_res_time_for_nod:0,compute_state_transitions_for_a_nod:0,concatanated_sampl:0,concaten:0,concatenated_sampl:0,condit:0,conditional_intensity_matrix:[2,3],conditionalintensitymatrix:0,consid:0,construct:[0,1],conta:0,contain:0,content:[2,3],convert:0,copi:0,core:0,correct:0,count:0,creat:[0,1],csv:1,csvimport:1,ctpc:[0,1],ctpc_algorithm:[0,1],current:0,cut:0,dafram:0,data:[0,2],datafram:[0,1],dataset:0,dataset_id:[0,1],datfram:0,def:1,definit:0,delta:0,demonstr:1,desir:0,df_samples_list:0,dict:[0,1],dictionari:0,differ:0,digraph:0,dimens:0,dir:1,direct:0,doc:0,doubl:0,download:1,drop:1,duplic:0,dyn:1,each:0,edg:[0,1],edges_list:0,end:0,entir:0,equal:0,est:1,estim:[0,2],everi:0,exam:1,exampl:[0,2],exclud:0,exctract:0,exp_test_alfa:0,exponenti:0,expos:0,extend:1,extens:0,extract:0,fals:0,fast_init:[0,1],file:[0,1],file_path:[0,1],filepath:0,fill:[0,1],filter:0,filter_cims_with_mask:0,find:0,first:[0,1],follow:0,form:0,format:1,found:0,frame:0,from:[0,1],from_nod:0,gener:0,generate_possible_sub_sets_of_s:0,get_cims_numb:0,get_node_id:0,get_node_indx:0,get_ordered_by_indx_set_of_par:0,get_parents_by_id:0,get_positional_node_indx:0,get_states_numb:0,given:0,glob:1,graph:[0,1],graph_struct:0,graphic:0,grid:0,grpah:1,has:[0,1],has_prior_net_structur:0,have:0,header:0,hold:0,how:0,hypothesi:0,identifi:0,iff:0,implement:[0,2],import_data:[0,1],import_sampled_cim:0,import_structur:0,import_trajectori:0,import_vari:[0,1],independ:0,independence_test:0,index:[0,1,2],indic:0,indx:0,info:[0,1],inform:0,init:1,initi:[0,1],inplac:1,input:0,insid:1,instal:2,interest:0,intes:0,iter:0,join:1,json:[0,1],json_import:[2,3],jsonarrai:0,jsonimport:[0,1],keep:0,kei:0,label:0,level:0,list:[0,1],list_of_column:0,list_of_edg:0,list_of_nod:0,load:0,loop:0,main:1,mask:0,mask_arr:0,matric:0,matrix:[0,1],member:0,mention:0,merg:0,method:0,model:0,modul:[2,3],multipl:0,name:[0,1],ndarrai:0,necessari:0,nest:0,net:[0,1],net_graph:0,network:0,network_graph:[2,3],networkgraph:[0,1],networkx:0,node:[0,1],node_id:0,node_index:0,node_indx:0,node_st:0,node_states_numb:0,nodes_index:0,nodes_indexes_arr:0,nodes_label:0,nodes_labels_list:0,nodes_numb:0,nodes_vals_arr:0,nodes_valu:[0,1],none:[0,1],normal:0,normalize_trajectori:0,number:0,numpi:0,obj:1,object:[0,1],one:0,one_iteration_of_ctpc_algorithm:0,one_level_norm:0,onli:0,order:0,origin:0,original_cols_numb:0,otherwis:0,out:0,outer:[0,1],over:0,own:2,p_comb:0,p_indx:0,packag:[2,3],page:2,panda:[0,1],param:0,paramet:[0,2],parameters_estim:[2,3],parametersestim:[0,1],parent:0,parent_label:0,parent_set:0,parents_cardin:0,parents_comb:0,parents_index:0,parents_label:0,parents_states_numb:0,parents_v:0,parents_valu:0,particular:0,pass:1,path:[0,1],peest:1,perform:0,pip:1,place:0,plot:0,posit:0,possibl:0,prepar:0,present:0,print:1,prior:[0,1],prior_net_structur:0,process:0,properli:0,properti:0,put:0,pyctbn:1,q_xx:0,raw:0,raw_data:0,read:[0,1],read_csv:1,read_csv_fil:1,read_fil:1,read_json_fil:0,real:[0,1],red:0,refer:0,reject:0,rel:0,relat:0,releas:1,remain:0,remov:0,remove_nod:0,repres:0,represent:0,res:0,resid:0,result:[0,1],results_:0,rtype:0,same:0,sampl:[0,1],sample_fram:[0,1],sample_path:[2,3],samplepath:[0,1],samples_label:0,save:[0,1],save_plot_estimated_structure_graph:0,save_result:[0,1],scalar_index:0,scalar_indexes_struct:0,se1:1,search:2,see:0,select:1,self:[0,1],sep_set:0,set:0,set_of_cim:[2,3],setofcim:[0,1],shift:0,shifted_cols_head:0,signific:0,simbol:0,simpl:1,simpli:1,sinc:0,size:0,socim:0,sofc1:1,sorter:0,specif:1,spuriou:0,spurious_edg:0,start:0,state:0,state_res_tim:0,state_residence_tim:0,state_transition_matrix:0,str:[0,1],string:0,structur:[2,3],structure_estim:[2,3],structure_estimation_exampl:1,structure_label:0,structureestim:[0,1],structut:0,style:0,submodul:[2,3],subset:0,symbol:0,synthet:0,take:1,tar:1,task:0,ternari:1,test:0,test_child:0,test_par:0,tha:0,thi:[0,1],three:1,time:[0,1],time_filt:0,time_kei:0,time_scalar_indexing_strucur:0,timestamp:0,to_nod:0,tot_vars_count:0,total:0,total_variables_count:0,total_variables_numb:0,traj:0,trajectori:[1,2,3],trajectories_kei:0,trajectri:1,transit:0,transition_filt:0,transition_matric:0,transition_scalar_indexing_structur:0,tri:0,tupl:0,tutori:0,two:0,type:[0,1],union:0,uniqu:0,unus:0,usag:2,use:1,used:0,using:0,valu:[0,1],values_list:1,var_id:0,variabl:[0,1],variable_cardin:0,variable_label:0,variables_kei:0,variables_label:0,vector:0,want:1,where:0,which:0,whl:1,without:0,word:0,you:[0,1],your:2},titles:["classes package","Examples","Welcome to PyCTBN\u2019s documentation!","classes"],titleterms:{"class":[0,3],"import":1,abstract_import:0,cach:0,conditional_intensity_matrix:0,content:0,data:1,document:2,estim:1,exampl:1,implement:1,indic:2,instal:1,json_import:0,modul:0,network_graph:0,own:1,packag:0,paramet:1,parameters_estim:0,pyctbn:2,sample_path:0,set_of_cim:0,structur:[0,1],structure_estim:0,submodul:0,tabl:2,trajectori:0,usag:1,welcom:2,your:1}}) \ No newline at end of file diff --git a/examples/simple_cvs_importer.py b/examples/simple_cvs_importer.py index 7655ff7..35e554c 100644 --- a/examples/simple_cvs_importer.py +++ b/examples/simple_cvs_importer.py @@ -44,7 +44,7 @@ class CSVImporter(AbstractImporter): def main(): - read_files = glob.glob(os.path.join('../../data', "*.csv")) + read_files = glob.glob(os.path.join('../data', "*.csv")) print(read_files[0]) csvimp = CSVImporter(read_files[0]) csvimp.import_data() diff --git a/setup.py b/setup.py index fbb2182..740b006 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ from setuptools import setup, find_packages -print(find_packages('.', exclude=['PyCTBN.tests'])) setup(name='PyCTBN', version='1.0', @@ -12,7 +11,7 @@ setup(name='PyCTBN', packages=find_packages('.', exclude=['PyCTBN.tests']), #packages=['PyCTBN.classes'], install_requires=[ - 'numpy', 'pandas', 'networkx', 'scipy', 'tqdm'], + 'numpy', 'pandas', 'networkx', 'scipy', 'matplotlib', 'tqdm'], dependency_links=['https://github.com/numpy/numpy', 'https://github.com/pandas-dev/pandas', 'https://github.com/networkx/networkx', 'https://github.com/scipy/scipy', 'https://github.com/tqdm/tqdm'], diff --git a/sphinx_output/_build/doctrees/classes.doctree b/sphinx_output/_build/doctrees/classes.doctree index 1d7d804..b49a587 100644 Binary files a/sphinx_output/_build/doctrees/classes.doctree and b/sphinx_output/_build/doctrees/classes.doctree differ diff --git a/sphinx_output/_build/doctrees/environment.pickle b/sphinx_output/_build/doctrees/environment.pickle index 42c0e4b..252e803 100644 Binary files a/sphinx_output/_build/doctrees/environment.pickle and b/sphinx_output/_build/doctrees/environment.pickle differ diff --git a/sphinx_output/_build/html/classes.html b/sphinx_output/_build/html/classes.html index 5f7476b..7b3d260 100644 --- a/sphinx_output/_build/html/classes.html +++ b/sphinx_output/_build/html/classes.html @@ -134,36 +134,31 @@

      classes.abstract_importer module

      -class classes.abstract_importer.AbstractImporter(file_path: str)
      +class classes.abstract_importer.AbstractImporter(file_path: str = None, concatenated_samples: Union[pandas.core.frame.DataFrame, numpy.ndarray] = None, variables: pandas.core.frame.DataFrame = None, prior_net_structure: pandas.core.frame.DataFrame = None)

      Bases: abc.ABC

      Abstract class that exposes all the necessary methods to process the trajectories and the net structure.

      Parameters
      -

      file_path (str) – the file path

      -
      -
      _concatenated_samples
      -

      Dataframe containing the concatenation of all the processed trajectories

      -
      -
      _df_structure
      -

      Dataframe containing the structure of the network (edges)

      +
        +
      • file_path (str) – the file path, or dataset name if you import already processed data

      • +
      • concatenated_samples (typing.Union[pandas.DataFrame, numpy.ndarray]) – Dataframe or numpy array containing the concatenation of all the processed trajectories

      • +
      • variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities

      • +
      -
      _df_variables
      -

      Dataframe containing the nodes cardinalities

      +
      Prior_net_structure
      +

      Dataframe containing the structure of the network (edges)

      _sorter
      -

      A list containing the columns header (excluding the time column) of the _concatenated_samples

      +

      A list containing the variables labels in the SAME order as the columns in concatenated_samples

      Warning

      -

      The class members _df_variables and _df_structure HAVE to be properly constructed +

      The parameters variables and prior_net_structure HAVE to be properly constructed as Pandas Dataframes with the following structure: Header of _df_structure = [From_Node | To_Node] -Header of _df_variables = [Variable_Label | Variable_Cardinality]

      -
      -
      -

      Note

      -

      If you don’t have prior network structure just leave _df_structure set to None.

      +Header of _df_variables = [Variable_Label | Variable_Cardinality] +See the tutorial on how to construct a correct concatenated_samples Dataframe/ndarray.

      Note

      @@ -171,11 +166,12 @@ Header of _df_variables = [Variable_Label | Variable_Cardinality]

      -build_list_of_samples_array(data_frame: pandas.core.frame.DataFrame) → List
      -

      Builds a List containing the columns of data_frame and converts them to a numpy array.

      +build_list_of_samples_array(concatenated_sample: Union[pandas.core.frame.DataFrame, numpy.ndarray]) → List +

      Builds a List containing the the delta times numpy array, and the complete transitions matrix

      Parameters
      -

      data_frame (pandas.Dataframe) – the dataframe from which the columns have to be extracted and converted

      +

      concatenated_sample (typing.Union[pandas.Dataframe, numpy.ndarray]) – the dataframe/array from which the time, and transitions matrix have to be extracted +and converted

      Returns

      the resulting list of numpy arrays

      @@ -981,6 +977,11 @@ contain the mentioned data.

      Clears all the unused dataframes in _importer Object

      +
      +
      +property has_prior_net_structure
      +
      +
      property structure
      @@ -1228,7 +1229,7 @@ The class member _t
      adjacency_matrix() → numpy.ndarray
      -

      Converts the estimated structrure _complete_graph to a boolean adjacency matrix representation.

      +

      Converts the estimated structure _complete_graph to a boolean adjacency matrix representation.

      Returns

      The adjacency matrix of the graph _complete_graph

      @@ -1343,6 +1344,13 @@ it is performed also the chi_test.

      +
      +
      +save_plot_estimated_structure_graph() → None
      +

      Plot the estimated structure in a graphical model style. +Spurious edges are colored in red.

      +
      +
      save_results() → None
      @@ -1350,6 +1358,23 @@ it is performed also the chi_test.

      The file is named as the input dataset but the results_ word is appended to the results file.

      +
      +
      +spurious_edges() → List
      +
      +
      Return the spurious edges present in the estimated structure, if a prior net structure is present in

      _sample_path.structure.

      +
      +
      +
      +
      Returns
      +

      A list containing the spurious edges

      +
      +
      Return type
      +

      List

      +
      +
      +
      +
      diff --git a/sphinx_output/_build/html/genindex.html b/sphinx_output/_build/html/genindex.html index e17f709..6c1d048 100644 --- a/sphinx_output/_build/html/genindex.html +++ b/sphinx_output/_build/html/genindex.html @@ -134,6 +134,7 @@ | E | F | G + | H | I | J | M @@ -406,6 +407,14 @@
    +

    H

    + + +
    +

    I

      @@ -547,6 +556,8 @@
        +
      • spurious_edges() (classes.structure_estimator.StructureEstimator method) +
      • state_residence_times() (classes.conditional_intensity_matrix.ConditionalIntensityMatrix property)
      • state_transition_matrix() (classes.conditional_intensity_matrix.ConditionalIntensityMatrix property) diff --git a/sphinx_output/_build/html/objects.inv b/sphinx_output/_build/html/objects.inv index 973ae93..d3c3f62 100644 Binary files a/sphinx_output/_build/html/objects.inv and b/sphinx_output/_build/html/objects.inv differ diff --git a/sphinx_output/_build/html/searchindex.js b/sphinx_output/_build/html/searchindex.js index 8aedd55..e113010 100644 --- a/sphinx_output/_build/html/searchindex.js +++ b/sphinx_output/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["classes","examples","index","modules"],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:["classes.rst","examples.rst","index.rst","modules.rst"],objects:{"":{classes:[0,0,0,"-"]},"classes.abstract_importer":{AbstractImporter:[0,1,1,""]},"classes.abstract_importer.AbstractImporter":{build_list_of_samples_array:[0,2,1,""],build_sorter:[0,2,1,""],clear_concatenated_frame:[0,2,1,""],compute_row_delta_in_all_samples_frames:[0,2,1,""],compute_row_delta_sigle_samples_frame:[0,2,1,""],concatenated_samples:[0,2,1,""],dataset_id:[0,2,1,""],file_path:[0,2,1,""],sorter:[0,2,1,""],structure:[0,2,1,""],variables:[0,2,1,""]},"classes.cache":{Cache:[0,1,1,""]},"classes.cache.Cache":{clear:[0,2,1,""],find:[0,2,1,""],put:[0,2,1,""]},"classes.conditional_intensity_matrix":{ConditionalIntensityMatrix:[0,1,1,""]},"classes.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[0,2,1,""],compute_cim_coefficients:[0,2,1,""],state_residence_times:[0,2,1,""],state_transition_matrix:[0,2,1,""]},"classes.json_importer":{JsonImporter:[0,1,1,""]},"classes.json_importer.JsonImporter":{build_sorter:[0,2,1,""],clear_data_frame_list:[0,2,1,""],dataset_id:[0,2,1,""],import_data:[0,2,1,""],import_sampled_cims:[0,2,1,""],import_structure:[0,2,1,""],import_trajectories:[0,2,1,""],import_variables:[0,2,1,""],normalize_trajectories:[0,2,1,""],one_level_normalizing:[0,2,1,""],read_json_file:[0,2,1,""]},"classes.network_graph":{NetworkGraph:[0,1,1,""]},"classes.network_graph.NetworkGraph":{add_edges:[0,2,1,""],add_nodes:[0,2,1,""],build_p_comb_structure_for_a_node:[0,2,1,""],build_time_columns_filtering_for_a_node:[0,2,1,""],build_time_scalar_indexing_structure_for_a_node:[0,2,1,""],build_transition_filtering_for_a_node:[0,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[0,2,1,""],clear_indexing_filtering_structures:[0,2,1,""],edges:[0,2,1,""],fast_init:[0,2,1,""],get_node_indx:[0,2,1,""],get_ordered_by_indx_set_of_parents:[0,2,1,""],get_parents_by_id:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_values:[0,2,1,""],p_combs:[0,2,1,""],remove_node:[0,2,1,""],time_filtering:[0,2,1,""],time_scalar_indexing_strucure:[0,2,1,""],transition_filtering:[0,2,1,""],transition_scalar_indexing_structure:[0,2,1,""]},"classes.parameters_estimator":{ParametersEstimator:[0,1,1,""]},"classes.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[0,2,1,""],compute_state_res_time_for_node:[0,2,1,""],compute_state_transitions_for_a_node:[0,2,1,""],fast_init:[0,2,1,""]},"classes.sample_path":{SamplePath:[0,1,1,""]},"classes.sample_path.SamplePath":{build_structure:[0,2,1,""],build_trajectories:[0,2,1,""],structure:[0,2,1,""],total_variables_count:[0,2,1,""],trajectories:[0,2,1,""]},"classes.set_of_cims":{SetOfCims:[0,1,1,""]},"classes.set_of_cims.SetOfCims":{actual_cims:[0,2,1,""],build_cims:[0,2,1,""],build_times_and_transitions_structures:[0,2,1,""],filter_cims_with_mask:[0,2,1,""],get_cims_number:[0,2,1,""],p_combs:[0,2,1,""]},"classes.structure":{Structure:[0,1,1,""]},"classes.structure.Structure":{edges:[0,2,1,""],get_node_id:[0,2,1,""],get_node_indx:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_labels:[0,2,1,""],nodes_values:[0,2,1,""],remove_node:[0,2,1,""],total_variables_number:[0,2,1,""]},"classes.structure_estimator":{StructureEstimator:[0,1,1,""]},"classes.structure_estimator.StructureEstimator":{adjacency_matrix:[0,2,1,""],build_complete_graph:[0,2,1,""],complete_test:[0,2,1,""],ctpc_algorithm:[0,2,1,""],generate_possible_sub_sets_of_size:[0,2,1,""],independence_test:[0,2,1,""],one_iteration_of_CTPC_algorithm:[0,2,1,""],save_results:[0,2,1,""]},"classes.trajectory":{Trajectory:[0,1,1,""]},"classes.trajectory.Trajectory":{complete_trajectory:[0,2,1,""],size:[0,2,1,""],times:[0,2,1,""],trajectory:[0,2,1,""]},classes:{abstract_importer:[0,0,0,"-"],cache:[0,0,0,"-"],conditional_intensity_matrix:[0,0,0,"-"],json_importer:[0,0,0,"-"],network_graph:[0,0,0,"-"],parameters_estimator:[0,0,0,"-"],sample_path:[0,0,0,"-"],set_of_cims:[0,0,0,"-"],structure:[0,0,0,"-"],structure_estimator:[0,0,0,"-"],trajectory:[0,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":[0,1],"boolean":0,"class":[1,2],"float":0,"import":[0,2],"int":0,"null":0,"return":[0,1],"static":0,"super":1,"true":[0,1],"var":1,HAS:0,Has:0,NOT:0,The:[0,1],Use:1,__init__:1,_actual_cach:0,_actual_cim:0,_actual_trajectori:0,_aggregated_info_about_nodes_par:0,_array_indx:0,_cach:0,_cim:0,_complete_graph:0,_concatenated_sampl:0,_df_samples_list:[0,1],_df_structur:0,_df_variabl:[0,1],_file_path:1,_graph:[0,1],_import:0,_list_of_sets_of_par:0,_net_graph:0,_node:0,_node_id:0,_nodes_indx:0,_nodes_v:0,_p_combs_structur:0,_raw_data:0,_sample_path:0,_single_set_of_cim:0,_sorter:[0,1],_state_residence_tim:0,_structur:0,_structure_label:0,_time:0,_time_filt:0,_time_scalar_indexing_structur:0,_total_variables_count:0,_total_variables_numb:0,_trajectori:0,_transition_filt:0,_transition_matric:0,_transition_scalar_indexing_structur:0,_variables_label:0,abc:0,about:0,abstract_import:[2,3],abstractimport:[0,1],act:0,actual:0,actual_cim:[0,1],add:0,add_edg:0,add_nod:0,added:0,addit:0,adjac:[0,1],adjacency_matrix:[0,1],after:0,aggreg:0,algorithm:[0,1],all:[0,1],alreadi:1,also:0,anoth:0,append:0,arc:0,arrai:[0,1],axi:1,base:0,belong:0,between:0,bool:0,both:0,bound:0,build:[0,1],build_cim:0,build_complete_graph:0,build_list_of_samples_arrai:0,build_p_comb_structure_for_a_nod:0,build_sort:[0,1],build_structur:[0,1],build_time_columns_filtering_for_a_nod:0,build_time_scalar_indexing_structure_for_a_nod:0,build_times_and_transitions_structur:0,build_trajectori:[0,1],build_transition_filtering_for_a_nod:0,build_transition_scalar_indexing_structure_for_a_nod:0,built:0,cach:[2,3],call:[0,1],cardin:0,cardinalit:0,caridin:0,caridinalit:0,chang:0,chi:0,chi_test:0,chi_test_alfa:0,child:0,child_states_numb:0,cim1:0,cim2:0,cim:[0,1],cims_kei:0,clear:0,clear_concatenated_fram:0,clear_data_frame_list:0,clear_indexing_filtering_structur:0,coeffici:0,col:0,cols_filt:0,column:[0,1],columns_head:0,comb:0,combin:0,combinatori:0,common:0,complet:0,complete_test:0,complete_trajectori:0,comput:[0,1],compute_cim_coeffici:0,compute_parameters_for_nod:[0,1],compute_row_delta_in_all_samples_fram:[0,1],compute_row_delta_sigle_samples_fram:0,compute_state_res_time_for_nod:0,compute_state_transitions_for_a_nod:0,concatanated_sampl:0,concaten:0,concatenated_sampl:0,condit:0,conditional_intensity_matrix:[2,3],conditionalintensitymatrix:0,consid:0,construct:[0,1],conta:0,contain:0,content:[2,3],convert:0,copi:0,core:0,correct:0,count:0,creat:[0,1],csv:1,csvimport:1,ctpc:[0,1],ctpc_algorithm:[0,1],current:0,cut:0,dafram:0,data:[0,2],data_fram:0,datafram:[0,1],dataset:0,dataset_id:[0,1],datfram:0,def:1,definit:0,delta:0,demonstr:1,desir:0,df_samples_list:0,dict:[0,1],dictionari:0,differ:0,digraph:0,dimens:0,dir:1,direct:0,doc:0,don:0,doubl:0,download:1,drop:1,duplic:0,dyn:1,each:0,edg:[0,1],edges_list:0,end:0,entir:0,equal:0,est:1,estim:[0,2],everi:0,exam:1,exampl:[0,2],exclud:0,exctract:0,exp_test_alfa:0,exponenti:0,expos:0,extend:1,extens:0,extract:0,fals:0,fast_init:[0,1],file:[0,1],file_path:[0,1],filepath:0,fill:[0,1],filter:0,filter_cims_with_mask:0,find:0,first:[0,1],follow:0,form:0,format:1,found:0,frame:0,from:[0,1],from_nod:0,gener:0,generate_possible_sub_sets_of_s:0,get_cims_numb:0,get_node_id:0,get_node_indx:0,get_ordered_by_indx_set_of_par:0,get_parents_by_id:0,get_positional_node_indx:0,get_states_numb:0,given:0,glob:1,graph:[0,1],graph_struct:0,grid:0,grpah:1,has:[0,1],have:0,header:0,hold:0,hypothesi:0,identifi:0,iff:0,implement:[0,2],import_data:[0,1],import_sampled_cim:0,import_structur:0,import_trajectori:0,import_vari:[0,1],independ:0,independence_test:0,index:[0,1,2],indic:0,indx:0,info:[0,1],inform:0,init:1,initi:[0,1],inplac:1,input:0,insid:1,instal:2,interest:0,intes:0,iter:0,join:1,json:[0,1],json_import:[2,3],jsonarrai:0,jsonimport:[0,1],just:0,keep:0,kei:0,label:0,leav:0,level:0,list:[0,1],list_of_column:0,list_of_edg:0,list_of_nod:0,load:0,loop:0,main:1,mask:0,mask_arr:0,matric:0,matrix:[0,1],member:0,mention:0,merg:0,method:0,modul:[2,3],multipl:0,name:[0,1],ndarrai:0,necessari:0,nest:0,net:[0,1],net_graph:0,network:0,network_graph:[2,3],networkgraph:[0,1],networkx:0,node:[0,1],node_id:0,node_index:0,node_indx:0,node_st:0,node_states_numb:0,nodes_index:0,nodes_indexes_arr:0,nodes_label:0,nodes_labels_list:0,nodes_numb:0,nodes_vals_arr:0,nodes_valu:[0,1],none:[0,1],normal:0,normalize_trajectori:0,number:0,numpi:0,obj:1,object:[0,1],one:0,one_iteration_of_ctpc_algorithm:0,one_level_norm:0,onli:0,origin:0,original_cols_numb:0,otherwis:0,out:0,outer:[0,1],over:0,own:2,p_comb:0,p_indx:0,packag:[2,3],page:2,panda:[0,1],param:0,paramet:[0,2],parameters_estim:[2,3],parametersestim:[0,1],parent:0,parent_label:0,parent_set:0,parents_cardin:0,parents_comb:0,parents_index:0,parents_label:0,parents_states_numb:0,parents_v:0,parents_valu:0,particular:0,pass:1,path:[0,1],peest:1,perform:0,pip:1,place:0,posit:0,possibl:0,prepar:0,present:0,print:1,prior:[0,1],process:0,properli:0,properti:0,put:0,pyctbn:1,q_xx:0,raw:0,raw_data:0,read:[0,1],read_csv:1,read_csv_fil:1,read_fil:1,read_json_fil:0,real:[0,1],refer:0,reject:0,rel:0,relat:0,releas:1,remain:0,remov:0,remove_nod:0,repres:0,represent:0,res:0,resid:0,result:[0,1],results_:0,rtype:0,same:0,sampl:[0,1],sample_fram:[0,1],sample_path:[2,3],samplepath:[0,1],samples_label:0,save:[0,1],save_result:[0,1],scalar_index:0,scalar_indexes_struct:0,se1:1,search:2,see:0,select:1,self:[0,1],sep_set:0,set:0,set_of_cim:[2,3],setofcim:[0,1],shift:0,shifted_cols_head:0,signific:0,simbol:0,simpl:1,simpli:1,sinc:0,size:0,socim:0,sofc1:1,sorter:0,specif:1,start:0,state:0,state_res_tim:0,state_residence_tim:0,state_transition_matrix:0,str:[0,1],string:0,structrur:0,structur:[2,3],structure_estim:[2,3],structure_estimation_exampl:1,structure_label:0,structureestim:[0,1],structut:0,submodul:[2,3],subset:0,symbol:0,synthet:0,take:1,tar:1,task:0,ternari:1,test:0,test_child:0,test_par:0,tha:0,them:0,thi:[0,1],three:1,time:[0,1],time_filt:0,time_kei:0,time_scalar_indexing_strucur:0,timestamp:0,to_nod:0,tot_vars_count:0,total:0,total_variables_count:0,total_variables_numb:0,traj:0,trajectori:[1,2,3],trajectories_kei:0,trajectri:1,transit:0,transition_filt:0,transition_matric:0,transition_scalar_indexing_structur:0,tri:0,tupl:0,two:0,type:[0,1],uniqu:0,unus:0,usag:2,use:1,used:0,using:0,valu:[0,1],values_list:1,var_id:0,variabl:[0,1],variable_cardin:0,variable_label:0,variables_kei:0,variables_label:0,vector:0,want:1,where:0,which:0,whl:1,without:0,word:0,you:[0,1],your:2},titles:["classes package","Examples","Welcome to PyCTBN\u2019s documentation!","classes"],titleterms:{"class":[0,3],"import":1,abstract_import:0,cach:0,conditional_intensity_matrix:0,content:0,data:1,document:2,estim:1,exampl:1,implement:1,indic:2,instal:1,json_import:0,modul:0,network_graph:0,own:1,packag:0,paramet:1,parameters_estim:0,pyctbn:2,sample_path:0,set_of_cim:0,structur:[0,1],structure_estim:0,submodul:0,tabl:2,trajectori:0,usag:1,welcom:2,your:1}}) \ No newline at end of file +Search.setIndex({docnames:["classes","examples","index","modules"],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:["classes.rst","examples.rst","index.rst","modules.rst"],objects:{"":{classes:[0,0,0,"-"]},"classes.abstract_importer":{AbstractImporter:[0,1,1,""]},"classes.abstract_importer.AbstractImporter":{build_list_of_samples_array:[0,2,1,""],build_sorter:[0,2,1,""],clear_concatenated_frame:[0,2,1,""],compute_row_delta_in_all_samples_frames:[0,2,1,""],compute_row_delta_sigle_samples_frame:[0,2,1,""],concatenated_samples:[0,2,1,""],dataset_id:[0,2,1,""],file_path:[0,2,1,""],sorter:[0,2,1,""],structure:[0,2,1,""],variables:[0,2,1,""]},"classes.cache":{Cache:[0,1,1,""]},"classes.cache.Cache":{clear:[0,2,1,""],find:[0,2,1,""],put:[0,2,1,""]},"classes.conditional_intensity_matrix":{ConditionalIntensityMatrix:[0,1,1,""]},"classes.conditional_intensity_matrix.ConditionalIntensityMatrix":{cim:[0,2,1,""],compute_cim_coefficients:[0,2,1,""],state_residence_times:[0,2,1,""],state_transition_matrix:[0,2,1,""]},"classes.json_importer":{JsonImporter:[0,1,1,""]},"classes.json_importer.JsonImporter":{build_sorter:[0,2,1,""],clear_data_frame_list:[0,2,1,""],dataset_id:[0,2,1,""],import_data:[0,2,1,""],import_sampled_cims:[0,2,1,""],import_structure:[0,2,1,""],import_trajectories:[0,2,1,""],import_variables:[0,2,1,""],normalize_trajectories:[0,2,1,""],one_level_normalizing:[0,2,1,""],read_json_file:[0,2,1,""]},"classes.network_graph":{NetworkGraph:[0,1,1,""]},"classes.network_graph.NetworkGraph":{add_edges:[0,2,1,""],add_nodes:[0,2,1,""],build_p_comb_structure_for_a_node:[0,2,1,""],build_time_columns_filtering_for_a_node:[0,2,1,""],build_time_scalar_indexing_structure_for_a_node:[0,2,1,""],build_transition_filtering_for_a_node:[0,2,1,""],build_transition_scalar_indexing_structure_for_a_node:[0,2,1,""],clear_indexing_filtering_structures:[0,2,1,""],edges:[0,2,1,""],fast_init:[0,2,1,""],get_node_indx:[0,2,1,""],get_ordered_by_indx_set_of_parents:[0,2,1,""],get_parents_by_id:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_values:[0,2,1,""],p_combs:[0,2,1,""],remove_node:[0,2,1,""],time_filtering:[0,2,1,""],time_scalar_indexing_strucure:[0,2,1,""],transition_filtering:[0,2,1,""],transition_scalar_indexing_structure:[0,2,1,""]},"classes.parameters_estimator":{ParametersEstimator:[0,1,1,""]},"classes.parameters_estimator.ParametersEstimator":{compute_parameters_for_node:[0,2,1,""],compute_state_res_time_for_node:[0,2,1,""],compute_state_transitions_for_a_node:[0,2,1,""],fast_init:[0,2,1,""]},"classes.sample_path":{SamplePath:[0,1,1,""]},"classes.sample_path.SamplePath":{build_structure:[0,2,1,""],build_trajectories:[0,2,1,""],has_prior_net_structure:[0,2,1,""],structure:[0,2,1,""],total_variables_count:[0,2,1,""],trajectories:[0,2,1,""]},"classes.set_of_cims":{SetOfCims:[0,1,1,""]},"classes.set_of_cims.SetOfCims":{actual_cims:[0,2,1,""],build_cims:[0,2,1,""],build_times_and_transitions_structures:[0,2,1,""],filter_cims_with_mask:[0,2,1,""],get_cims_number:[0,2,1,""],p_combs:[0,2,1,""]},"classes.structure":{Structure:[0,1,1,""]},"classes.structure.Structure":{edges:[0,2,1,""],get_node_id:[0,2,1,""],get_node_indx:[0,2,1,""],get_positional_node_indx:[0,2,1,""],get_states_number:[0,2,1,""],nodes_indexes:[0,2,1,""],nodes_labels:[0,2,1,""],nodes_values:[0,2,1,""],remove_node:[0,2,1,""],total_variables_number:[0,2,1,""]},"classes.structure_estimator":{StructureEstimator:[0,1,1,""]},"classes.structure_estimator.StructureEstimator":{adjacency_matrix:[0,2,1,""],build_complete_graph:[0,2,1,""],complete_test:[0,2,1,""],ctpc_algorithm:[0,2,1,""],generate_possible_sub_sets_of_size:[0,2,1,""],independence_test:[0,2,1,""],one_iteration_of_CTPC_algorithm:[0,2,1,""],save_plot_estimated_structure_graph:[0,2,1,""],save_results:[0,2,1,""],spurious_edges:[0,2,1,""]},"classes.trajectory":{Trajectory:[0,1,1,""]},"classes.trajectory.Trajectory":{complete_trajectory:[0,2,1,""],size:[0,2,1,""],times:[0,2,1,""],trajectory:[0,2,1,""]},classes:{abstract_importer:[0,0,0,"-"],cache:[0,0,0,"-"],conditional_intensity_matrix:[0,0,0,"-"],json_importer:[0,0,0,"-"],network_graph:[0,0,0,"-"],parameters_estimator:[0,0,0,"-"],sample_path:[0,0,0,"-"],set_of_cims:[0,0,0,"-"],structure:[0,0,0,"-"],structure_estimator:[0,0,0,"-"],trajectory:[0,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":[0,1],"boolean":0,"class":[1,2],"float":0,"import":[0,2],"int":0,"null":0,"return":[0,1],"static":0,"super":1,"true":[0,1],"var":1,HAS:0,Has:0,NOT:0,The:[0,1],Use:1,__init__:1,_actual_cach:0,_actual_cim:0,_actual_trajectori:0,_aggregated_info_about_nodes_par:0,_array_indx:0,_cach:0,_cim:0,_complete_graph:0,_df_samples_list:[0,1],_df_structur:0,_df_variabl:[0,1],_file_path:1,_graph:[0,1],_import:0,_list_of_sets_of_par:0,_net_graph:0,_node:0,_node_id:0,_nodes_indx:0,_nodes_v:0,_p_combs_structur:0,_raw_data:0,_sample_path:0,_single_set_of_cim:0,_sorter:[0,1],_state_residence_tim:0,_structur:0,_structure_label:0,_time:0,_time_filt:0,_time_scalar_indexing_structur:0,_total_variables_count:0,_total_variables_numb:0,_trajectori:0,_transition_filt:0,_transition_matric:0,_transition_scalar_indexing_structur:0,_variables_label:0,abc:0,about:0,abstract_import:[2,3],abstractimport:[0,1],act:0,actual:0,actual_cim:[0,1],add:0,add_edg:0,add_nod:0,added:0,addit:0,adjac:[0,1],adjacency_matrix:[0,1],after:0,aggreg:0,algorithm:[0,1],all:[0,1],alreadi:[0,1],also:0,anoth:0,append:0,arc:0,arrai:[0,1],axi:1,base:0,belong:0,between:0,bool:0,both:0,bound:0,build:[0,1],build_cim:0,build_complete_graph:0,build_list_of_samples_arrai:0,build_p_comb_structure_for_a_nod:0,build_sort:[0,1],build_structur:[0,1],build_time_columns_filtering_for_a_nod:0,build_time_scalar_indexing_structure_for_a_nod:0,build_times_and_transitions_structur:0,build_trajectori:[0,1],build_transition_filtering_for_a_nod:0,build_transition_scalar_indexing_structure_for_a_nod:0,built:0,cach:[2,3],call:[0,1],cardin:0,cardinalit:0,caridin:0,caridinalit:0,chang:0,chi:0,chi_test:0,chi_test_alfa:0,child:0,child_states_numb:0,cim1:0,cim2:0,cim:[0,1],cims_kei:0,clear:0,clear_concatenated_fram:0,clear_data_frame_list:0,clear_indexing_filtering_structur:0,coeffici:0,col:0,color:0,cols_filt:0,column:[0,1],columns_head:0,comb:0,combin:0,combinatori:0,common:0,complet:0,complete_test:0,complete_trajectori:0,comput:[0,1],compute_cim_coeffici:0,compute_parameters_for_nod:[0,1],compute_row_delta_in_all_samples_fram:[0,1],compute_row_delta_sigle_samples_fram:0,compute_state_res_time_for_nod:0,compute_state_transitions_for_a_nod:0,concatanated_sampl:0,concaten:0,concatenated_sampl:0,condit:0,conditional_intensity_matrix:[2,3],conditionalintensitymatrix:0,consid:0,construct:[0,1],conta:0,contain:0,content:[2,3],convert:0,copi:0,core:0,correct:0,count:0,creat:[0,1],csv:1,csvimport:1,ctpc:[0,1],ctpc_algorithm:[0,1],current:0,cut:0,dafram:0,data:[0,2],datafram:[0,1],dataset:0,dataset_id:[0,1],datfram:0,def:1,definit:0,delta:0,demonstr:1,desir:0,df_samples_list:0,dict:[0,1],dictionari:0,differ:0,digraph:0,dimens:0,dir:1,direct:0,doc:0,doubl:0,download:1,drop:1,duplic:0,dyn:1,each:0,edg:[0,1],edges_list:0,end:0,entir:0,equal:0,est:1,estim:[0,2],everi:0,exam:1,exampl:[0,2],exclud:0,exctract:0,exp_test_alfa:0,exponenti:0,expos:0,extend:1,extens:0,extract:0,fals:0,fast_init:[0,1],file:[0,1],file_path:[0,1],filepath:0,fill:[0,1],filter:0,filter_cims_with_mask:0,find:0,first:[0,1],follow:0,form:0,format:1,found:0,frame:0,from:[0,1],from_nod:0,gener:0,generate_possible_sub_sets_of_s:0,get_cims_numb:0,get_node_id:0,get_node_indx:0,get_ordered_by_indx_set_of_par:0,get_parents_by_id:0,get_positional_node_indx:0,get_states_numb:0,given:0,glob:1,graph:[0,1],graph_struct:0,graphic:0,grid:0,grpah:1,has:[0,1],has_prior_net_structur:0,have:0,header:0,hold:0,how:0,hypothesi:0,identifi:0,iff:0,implement:[0,2],import_data:[0,1],import_sampled_cim:0,import_structur:0,import_trajectori:0,import_vari:[0,1],independ:0,independence_test:0,index:[0,1,2],indic:0,indx:0,info:[0,1],inform:0,init:1,initi:[0,1],inplac:1,input:0,insid:1,instal:2,interest:0,intes:0,iter:0,join:1,json:[0,1],json_import:[2,3],jsonarrai:0,jsonimport:[0,1],keep:0,kei:0,label:0,level:0,list:[0,1],list_of_column:0,list_of_edg:0,list_of_nod:0,load:0,loop:0,main:1,mask:0,mask_arr:0,matric:0,matrix:[0,1],member:0,mention:0,merg:0,method:0,model:0,modul:[2,3],multipl:0,name:[0,1],ndarrai:0,necessari:0,nest:0,net:[0,1],net_graph:0,network:0,network_graph:[2,3],networkgraph:[0,1],networkx:0,node:[0,1],node_id:0,node_index:0,node_indx:0,node_st:0,node_states_numb:0,nodes_index:0,nodes_indexes_arr:0,nodes_label:0,nodes_labels_list:0,nodes_numb:0,nodes_vals_arr:0,nodes_valu:[0,1],none:[0,1],normal:0,normalize_trajectori:0,number:0,numpi:0,obj:1,object:[0,1],one:0,one_iteration_of_ctpc_algorithm:0,one_level_norm:0,onli:0,order:0,origin:0,original_cols_numb:0,otherwis:0,out:0,outer:[0,1],over:0,own:2,p_comb:0,p_indx:0,packag:[2,3],page:2,panda:[0,1],param:0,paramet:[0,2],parameters_estim:[2,3],parametersestim:[0,1],parent:0,parent_label:0,parent_set:0,parents_cardin:0,parents_comb:0,parents_index:0,parents_label:0,parents_states_numb:0,parents_v:0,parents_valu:0,particular:0,pass:1,path:[0,1],peest:1,perform:0,pip:1,place:0,plot:0,posit:0,possibl:0,prepar:0,present:0,print:1,prior:[0,1],prior_net_structur:0,process:0,properli:0,properti:0,put:0,pyctbn:1,q_xx:0,raw:0,raw_data:0,read:[0,1],read_csv:1,read_csv_fil:1,read_fil:1,read_json_fil:0,real:[0,1],red:0,refer:0,reject:0,rel:0,relat:0,releas:1,remain:0,remov:0,remove_nod:0,repres:0,represent:0,res:0,resid:0,result:[0,1],results_:0,rtype:0,same:0,sampl:[0,1],sample_fram:[0,1],sample_path:[2,3],samplepath:[0,1],samples_label:0,save:[0,1],save_plot_estimated_structure_graph:0,save_result:[0,1],scalar_index:0,scalar_indexes_struct:0,se1:1,search:2,see:0,select:1,self:[0,1],sep_set:0,set:0,set_of_cim:[2,3],setofcim:[0,1],shift:0,shifted_cols_head:0,signific:0,simbol:0,simpl:1,simpli:1,sinc:0,size:0,socim:0,sofc1:1,sorter:0,specif:1,spuriou:0,spurious_edg:0,start:0,state:0,state_res_tim:0,state_residence_tim:0,state_transition_matrix:0,str:[0,1],string:0,structur:[2,3],structure_estim:[2,3],structure_estimation_exampl:1,structure_label:0,structureestim:[0,1],structut:0,style:0,submodul:[2,3],subset:0,symbol:0,synthet:0,take:1,tar:1,task:0,ternari:1,test:0,test_child:0,test_par:0,tha:0,thi:[0,1],three:1,time:[0,1],time_filt:0,time_kei:0,time_scalar_indexing_strucur:0,timestamp:0,to_nod:0,tot_vars_count:0,total:0,total_variables_count:0,total_variables_numb:0,traj:0,trajectori:[1,2,3],trajectories_kei:0,trajectri:1,transit:0,transition_filt:0,transition_matric:0,transition_scalar_indexing_structur:0,tri:0,tupl:0,tutori:0,two:0,type:[0,1],union:0,uniqu:0,unus:0,usag:2,use:1,used:0,using:0,valu:[0,1],values_list:1,var_id:0,variabl:[0,1],variable_cardin:0,variable_label:0,variables_kei:0,variables_label:0,vector:0,want:1,where:0,which:0,whl:1,without:0,word:0,you:[0,1],your:2},titles:["classes package","Examples","Welcome to PyCTBN\u2019s documentation!","classes"],titleterms:{"class":[0,3],"import":1,abstract_import:0,cach:0,conditional_intensity_matrix:0,content:0,data:1,document:2,estim:1,exampl:1,implement:1,indic:2,instal:1,json_import:0,modul:0,network_graph:0,own:1,packag:0,paramet:1,parameters_estim:0,pyctbn:2,sample_path:0,set_of_cim:0,structur:[0,1],structure_estim:0,submodul:0,tabl:2,trajectori:0,usag:1,welcom:2,your:1}}) \ No newline at end of file