conformal
Estimate calibrated prediction intervals for causal effects, addressing covariate shift, counterfactuals, and heterogeneous treatment effects with valid coverage.
Instructions
Unified conformal causal inference dispatcher. kind= selects the estimator: 'cate' / 'counterfactual' / 'ite' (Lei-Candes 2021 base) / 'weighted' (TBCR 2019 primitive) / 'density' / 'multidp' / 'debiased' / 'fair' (2025-2026 frontier) / 'continuous' (dose-response) / 'interference' (cluster-exchangeable). Kwargs pass through to the target function; see sp.conformal_family guide. Assumptions: Exchangeability of calibration and test points (base case); For kind='weighted': known or estimable density ratio between calibration and test; For kind='cate' / 'ite': selection-on-observables with correct propensity / outcome model. Pre-conditions: calibration sample disjoint from training sample (auto-split or user-supplied); exchangeability between calibration and test distributions (weighted variants for covariate shift); for CATE / ITE variants: unconfoundedness + overlap on covariates. Failure modes: Calibration and test distributions differ (covariate shift) -> Use kind='weighted' with estimated density ratios; Calibration set too small -- intervals wide -> Increase calibration sample or raise alpha; coverage gets loose below ~100; Miscalibrated nuisance (propensity / outcome) for CATE...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Conformal estimator -- call sp.conformal_available_kinds() for the full list. | cate |
| detail | No | Payload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip. | agent |
| as_handle | No | If true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running. | |
| data_path | No | Absolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://. | |
| result_id | No | Optional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns. | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||