API Reference
Technical reference for the shipped GeoLift interfaces.
Interface Hierarchy
Primary operational interface:
- installed
geoliftCLI
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:
geolift powergeolift donorsgeolift infergeolift 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- GeoLift 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:
attp_valueci_lowerci_uppersesignificant
Detailed diagnostics remain on analyzer.diagnostics.
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.jsonuplift_timeseries.pngwhen plot generation is enabled
Power outputs:
power_analysis_results.csvpower_curves.png
Donor outputs:
donor_eval_results.csvdonor_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->geolift pipeline --config data-config/geolift_analysis_config.yaml - source-checkout:
python recipes/power_calculator_sparsesc.py ...->geolift power ... - source-checkout:
python recipes/donor_evaluator.py ...->geolift donors ... - source-checkout:
python recipes/geolift_multi_cell.py ...->geolift infer ...