You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/search_methods_index/Constraint-based causal discovery methods/PC.rst
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,14 +35,41 @@ Usage
35
35
36
36
Visualization using pydot is recommended. If specific label names are needed, please refer to this `usage example <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestGraphVisualization.py>`_ (e.g., 'cg.draw_pydot_graph(labels=["A", "B", "C"])' or 'GraphUtils.to_pydot(cg.G, labels=["A", "B", "C"])').
37
37
38
+
+++++++++++++++
39
+
Advanced Usages
40
+
+++++++++++++++
41
+
+ If you would like to specify parameters for the (conditional) independence test (if available), you may directly pass the parameters to the :code:`pc` call. E.g.,
42
+
43
+
.. code-block:: python
44
+
45
+
from causallearn.search.ConstraintBased.PCimport pc
+ If your graph is big and/or your independence test is slow (e.g., KCI), you may want to cache the p-value results to a local checkpoint. Then by reading values from this local checkpoint, no more repeated calculation will be wasted to resume from checkpoint / just finetune some PC parameters. This can be achieved by specifying :code:`cache_path`. E.g.,
If :code:`cache_path` does not exist in your local file system, a new one will be created. Otherwise, the cache will be first loaded from the json file to the CIT class and used during the runtime. Note that 1) data hash and parameters hash will first be checked at loading to ensure consistency, and 2) during runtime, the cache will be saved to the local file every 30 seconds.
61
+
62
+
+ The above advanced usages also apply to other constraint-based methods, e.g., FCI and CDNOD.
63
+
64
+
38
65
Parameters
39
66
-------------------
40
67
**data**: numpy.ndarray, shape (n_samples, n_features). Data, where n_samples is the number of samples
41
68
and n_features is the number of features.
42
69
43
70
**alpha**: desired significance level (float) in (0, 1). Default: 0.05.
44
71
45
-
**indep_test**: Independence test method function. Default: 'fisherz'.
72
+
**indep_test**: string, name of the independence test method. Default: 'fisherz'.
46
73
- ":ref:`fisherz <Fisher-z test>`": Fisher's Z conditional independence test.
0 commit comments