causalcompass.algorithms.TSCI

class causalcompass.algorithms.TSCI(theta=0.5, fnn_tol=0.01, seed=None, **kwargs)[source]

Topology-based causal discovery method that leverages Takens’ state-space reconstruction theory to infer causality.

References

https://github.com/KurtButler/tangentspaces

Parameters:
  • theta (float, default 0.5) – Parameter for lag selection

  • fnn_tol (float, default 0.01) – Tolerance for the amount of false nearest neighbors

  • seed (int, default None) – Random seed for reproducibility

Examples

>>> from causalcompass.algorithms import TSCI
>>> model = TSCI(theta=0.5, fnn_tol=0.01, seed=0)
>>> predicted_adj = model.run(X)
>>> all_metrics, no_diag_metrics = model.eval(true_adj, predicted_adj)
__init__(theta=0.5, fnn_tol=0.01, seed=None, **kwargs)[source]

Initialize TSCI

Methods

__init__([theta, fnn_tol, seed])

Initialize TSCI

eval(true_adj, predicted_adj[, shd_thresholds])

Evaluate the predicted adjacency matrix against the ground truth.

run(X)

Run TSCI algorithm.

run_raw(X, **kwargs)

Run the algorithm and return an unthresholded intermediate result that can be reused across multiple threshold values.

run_threshold_sweep(X, thresholds)

Run the algorithm once and post-process the raw result for each threshold.