1
0
Fork 0

Add docs params to StructureEst class

master
Filippo Martini 4 years ago
parent 028e6f6b22
commit b4964c0a17
  1. 124
      .idea/workspace.xml
  2. 7
      PyCTBN/PyCTBN/estimators/structure_constraint_based_estimator.py
  3. 2
      PyCTBN/PyCTBN/estimators/structure_estimator.py

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="4adfa503-a9d9-4b31-a5d8-3bd9cd9214ea" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/PyCTBN.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/CTBN_project_dominio.pdf" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/PyCTBN/PyCTBN/estimators/structure_estimator.py" beforeDir="false" afterPath="$PROJECT_DIR$/PyCTBN/PyCTBN/estimators/structure_estimator.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PyCTBN/PyCTBN/structure_graph/sample_path.py" beforeDir="false" afterPath="$PROJECT_DIR$/PyCTBN/PyCTBN/structure_graph/sample_path.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PyCTBN/PyCTBN/utility/json_importer.py" beforeDir="false" afterPath="$PROJECT_DIR$/PyCTBN/PyCTBN/utility/json_importer.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PyCTBN/tests/estimators/test_structure_estimator.py" beforeDir="false" afterPath="$PROJECT_DIR$/PyCTBN/tests/estimators/test_structure_estimator.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/basic_main.py" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1pR9CzNoVmzUM8b1VxIS85Q2acE" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
</component>
<component name="RunManager" selected="Python tests.Unittests in test_structure_estimator.py">
<configuration name="Unittests for PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_adjacency_matrix" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="PyCTBN" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_adjacency_matrix&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="Unittests for PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_save_plot_estimated_graph" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="PyCTBN" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_save_plot_estimated_graph&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="Unittests for PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_save_results" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="PyCTBN" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_save_results&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="Unittests in test_structure_estimator.py" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="PyCTBN" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/PyCTBN/tests/estimators/test_structure_estimator.py&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python tests.Unittests in test_structure_estimator.py" />
<item itemvalue="Python tests.Unittests for PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_save_plot_estimated_graph" />
<item itemvalue="Python tests.Unittests for PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_save_results" />
<item itemvalue="Python tests.Unittests for PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator.test_adjacency_matrix" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4adfa503-a9d9-4b31-a5d8-3bd9cd9214ea" name="Default Changelist" comment="" />
<created>1615134950460</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1615134950460</updated>
</task>
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project>

@ -38,6 +38,10 @@ class StructureConstraintBasedEstimator(StructureEstimator):
:type exp_test_alfa: float :type exp_test_alfa: float
:param chi_test_alfa: the significance level for the chi Hp test :param chi_test_alfa: the significance level for the chi Hp test
:type chi_test_alfa: float :type chi_test_alfa: float
:param: thumb_threshold: the threshold value to consider a valid independence test
:type thumb_threshold: int
:param known_edges: the prior known edges in the net structure if present
:type known_edges: List
:_nodes: the nodes labels :_nodes: the nodes labels
:_nodes_vals: the nodes cardinalities :_nodes_vals: the nodes cardinalities
:_nodes_indxs: the nodes indexes :_nodes_indxs: the nodes indexes
@ -45,7 +49,8 @@ class StructureConstraintBasedEstimator(StructureEstimator):
:_cache: the Cache object :_cache: the Cache object
""" """
def __init__(self, sample_path: SamplePath, exp_test_alfa: float, chi_test_alfa: float,known_edges: typing.List= [],thumb_threshold:int = 25): def __init__(self, sample_path: SamplePath, exp_test_alfa: float, chi_test_alfa: float,known_edges: typing.List= [],
thumb_threshold:int = 25):
super().__init__(sample_path,known_edges) super().__init__(sample_path,known_edges)
self._exp_test_sign = exp_test_alfa self._exp_test_sign = exp_test_alfa
self._chi_test_alfa = chi_test_alfa self._chi_test_alfa = chi_test_alfa

@ -25,6 +25,8 @@ class StructureEstimator(object):
:param sample_path: the _sample_path object containing the trajectories and the real structure :param sample_path: the _sample_path object containing the trajectories and the real structure
:type sample_path: SamplePath :type sample_path: SamplePath
:param known_edges: the prior known edges in the net structure if present
:type known_edges: List
:_nodes: the nodes labels :_nodes: the nodes labels
:_nodes_vals: the nodes cardinalities :_nodes_vals: the nodes cardinalities
:_nodes_indxs: the nodes indexes :_nodes_indxs: the nodes indexes