causalcompass.algorithms.CUTS

class causalcompass.algorithms.CUTS(input_step=10, batch_size=32, weight_decay=0.001, device='cuda', seed=None, **kwargs)[source]

CUTS is a deep learning-based causal discovery method tailored for irregular time series data.

References

https://github.com/jarrycyx/UNN

Parameters:
  • input_step (int, default 10) – Number of past time steps used as input

  • batch_size (int, default 32) – Training batch size

  • weight_decay (float, default 0.001) – Controls the strength of regularization

  • device (str, default 'cuda') – Computation device

Examples

>>> from causalcompass.algorithms import CUTS
>>> model = CUTS(input_step=10, batch_size=32, weight_decay=0.001, device='cuda')
>>> predicted_adj = model.run(X, true_cm=true_adj, mask=mask, original_data=X)
>>> all_metrics, no_diag_metrics = model.eval(true_adj, predicted_adj)
__init__(input_step=10, batch_size=32, weight_decay=0.001, device='cuda', seed=None, **kwargs)[source]

Initialize CUTS

Methods

__init__([input_step, batch_size, ...])

Initialize CUTS

eval(true_adj, predicted_adj[, shd_thresholds])

Evaluate the predicted adjacency matrix against the ground truth.

run(X, true_cm[, mask, original_data])

Run CUTS 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.