causal_forest
Estimate heterogeneous treatment effects from observational data, showing how impact varies across segments to guide targeted decisions.
Instructions
Causal Forest for heterogeneous treatment effect estimation (CATE). Validation: certified evidence with scoped limitations. Known limitations: The AIPW ATE/ATT are validated against grf on clean-overlap designs only; under severe propensity-overlap loss the AIPW influence function inflates the standard error (conservative, over-covering inference), so inspect the sp.audit overlap diagnostic before interpreting the ATE on that kind of sample. Assumptions: Unconfoundedness: Y(d) perp D | X; Overlap: 0 < P(D=1 | X) < 1 for the estimand support; Honest splitting: splits and estimates use disjoint samples (enforced by default). Pre-conditions: formula uses pipe separator: 'y ~ treatment | x_1 + x_2 + ...'; treatment is binary 0/1 (use sp.multi_arm_forest for multi-valued); covariates are numeric; encode categoricals beforehand. Failure modes: Calibration test (sp.calibration_test) rejects -> CATE predictions are miscalibrated -- increase n_trees, add variables, or switch to a DR-Learner; Variance of CATE estimates too large to be useful -> Need more observations or narrower conditioning set; consider GATE on discrete subgroups; Extreme propensity scores in part of the covariate space -...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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 |
| formula | Yes | 'y ~ treatment | x1 + x2' (pipe separates covariates) | |
| n_trees | No | Number of trees. | |
| 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 | Yes | 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 | |||