causalcompass.algorithms.CUTSPlus
- class causalcompass.algorithms.CUTSPlus(input_step=10, batch_size=32, weight_decay=0.001, device='cuda', seed=None, **kwargs)[source]
CUTS+ extends the original CUTS framework.
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 CUTSPlus >>> model = CUTSPlus(input_step=10, batch_size=32, weight_decay=0.001, device='cuda') >>> predicted_adj = model.run(X, true_cm=true_adj, mask=mask) >>> 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])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.