API Reference
Technical reference for the shipped GeoSC interfaces.
Interface Hierarchy
Primary operational interface:
- installed
geoscCLI and compatibilitygeoliftCLI
Programmatic interface:
GeoLiftAnalyzerload_configload_and_prepare_dataprocess_sparse_sc_results
Compatibility interfaces:
runme.pyrecipes/
For the exact CLI command surface, see CLI Reference.
Installed CLI
Installed commands:
geosc powergeosc donorsgeosc infergeosc pipeline
Shared flags on all commands:
--config--output-dir--jobs--use-gpu--no-progress--quiet
Infer-only flags:
--data--create-plots--no-create-plots
Pipeline-only flags:
--skip-power--skip-donor--only-inference--report--no-report
Pipeline config contract:
pipeline --configaccepts one canonical stage YAML path- GeoSC resolves sibling canonical YAMLs from the same directory
- there is no separate pipeline config schema
Core Classes
GeoLiftAnalyzer
Main orchestration class for causal inference analysis using SparseSC-backed estimation.
Initialization modes:
- File-based:
config_pathplusdata_path - Direct data: prepared
outcomes_dfplusunit_treatment_periods
File-based example with user-owned config and data paths:
Source-checkout example:
Direct-data example:
run_geolift_analysis()
Executes the full inference workflow and returns the compact top-level results dictionary.
Returned fields include:
schema_versionstatusattp_valuep_value_methodn_placebosmax_n_placebospossible_placebosp_value_placebo_modeplacebo_seedci_lowerci_uppercisese_availablese_approx_from_cise_approx_availablese_approximation_methodsignificantsignificance_availableassumption_statusassumption_requiredassumption_checks_runassumption_checks_completed
Detailed diagnostics remain on analyzer.diagnostics. Assumption validation is
available on analyzer.assumption_validation and, when output_dir is set, in
assumption_validation.json.
analyzer.diagnostics["inference"] records the estimator method, placebo mode,
seed, requested placebo count, possible combinations, and effective placebo
count. The seed is material only when the placebo mode is sampled.
For the 0.3.0 beta, these public wrapper semantics are release-certified by
the statistical certification gate in scripts/verify_release_candidate.py.
That gate covers SparseSC parity, deterministic effect recovery,
timing/orientation, artifact parity, uncertainty and placebo metadata, donor
design-stage semantics, power failure accounting, assumption-validator status
metadata, and release-preflight schema regressions. It does not certify that a
specific campaign satisfies causal-design assumptions.
run_analysis()
Primary convenience entry point that delegates to run_geolift_analysis().
Either method is valid on the shipped class.
plot_results(output_path: str | None = None) -> str
Generates and saves the uplift time-series plot. When output_path is omitted,
the plot is written to <output_dir>/uplift_timeseries.png.
Utility Functions
load_and_prepare_data(...)
File-based data preparation helper used by the analyser path.
load_config(path)
Loads one YAML config file.
process_sparse_sc_results(sparse_sc_results, config)
Transforms SparseSC outputs into the compact top-level results plus the richer diagnostics payload.
Output Artifacts
Inference outputs:
geolift_results.jsongeolift_diagnostics.jsondata_validation.jsonassumption_validation.jsonuplift_timeseries.pngwhen plot generation is enabled
Power outputs:
power_analysis_results.csvpower_curves.png
Power CSV rows include reproducibility and failure fields such as
random_seed, n_failed, failure_rate, valid, dgp_rank, and
requested_max_n_pl, possible_placebos, effective_max_n_pl,
dgp_backend, and generation_backend.
Donor outputs:
donor_eval_results.csvdonor_pool_quality.jsondonor_map_*.png
Pipeline reports:
geolift_pipeline_report.mdgeolift_pipeline_report.html
Compatibility Surfaces
runme.py and the scripts in recipes/ remain available for compatibility.
They are not the primary documented interface.
Migration map:
- source-checkout:
python runme.py->geosc pipeline --config data-config/geolift_analysis_config.yaml - source-checkout:
python recipes/power_calculator_sparsesc.py ...->geosc power ... - source-checkout:
python recipes/donor_evaluator.py ...->geosc donors ... - source-checkout:
python recipes/geolift_multi_cell.py ...->geosc infer ...