causalexplain.estimators.fci package#

Submodules#

FCI algorithm.

A graph learner which wraps the implementation of the FCI algorithm in the (c) causallearn library (py-why/causal-learn).

class FCI(name, independence_test_method='fisherz', alpha=0.05, depth=-1, max_path_length=-1, verbose=False, background_knowledge=None, show_progress=True, node_names=None, causes_only=True)[source]#

Bases: object

A graph learner which wraps the implementation of the FCI algorithm in (c) causallearn library (py-why/causal-learn).

__init__(name, independence_test_method='fisherz', alpha=0.05, depth=-1, max_path_length=-1, verbose=False, background_knowledge=None, show_progress=True, node_names=None, causes_only=True)[source]#

Initialize the FCI algorithm creating an FCI learner.

Parameters:
  • name (str, name of the experiment)

  • independence_test_method (str, name of the function of the independence) – test method being used: [fisherz, chisq, gsq, kci] - fisherz: Fisher’s Z conditional independence test - chisq: Chi-squared conditional independence test - gsq: G-squared conditional independence test - kci: Kernel-based conditional independence test

  • alpha (float, desired significance level of independence tests) – (p_value) in (0,1)

  • depth (The depth for the fast adjacency search, or -1 if unlimited)

  • max_path_length (the maximum length of any discriminating path,) – or -1 if unlimited.

  • verbose (True is verbose output should be printed or logged)

  • background_knowledge (background knowledge)

  • causes_only (bool, if True, only causes are returned) – (default: True), by filtering the CPDAG and considering only the edges indicating a causal relationship.

fit_predict(X, X_test=None, ref_graph=None)[source]#

Fit the model and return the estimated graph.

filter_causes_only(adj_matrix)[source]#

Filter the adjacency matrix to include only causal relationships.

This method processes the input adjacency matrix and creates a new matrix that only includes direct causal relationships (i.e., where i causes j).

main(dataset_name, input_path='/Users/renero/phd/data/sachs/', output_path='/Users/renero/phd/output/RC4/sachs/compared/', save=False, **kwargs)[source]#

Create a call to FCI with a sample dataset.

Module contents#