openavmkit.headless
Run the OpenAVMKit pipeline stages without Jupyter.
The notebooks in notebooks/pipeline are the reference workflow. This module
runs the same sequence of :mod:openavmkit.pipeline calls from plain Python, so
scripts, CI jobs and desktop front ends can drive a locality end to end and
receive structured progress (see :mod:openavmkit.progress).
Stages mirror the notebooks:
assemble-- 01-assemble: load, merge, enrich, tag model groups.clean-- 02-clean: fills, equity clusters, sales processing, scrutiny.model-- 03-model: splits, spatial lag, area stats, try/finalize models, ratio study report.
Like the notebooks, a stage works inside its locality folder (in/, out/,
cache/). :func:run_stage changes into that folder for the duration of the
call and restores the previous working directory afterwards; it is meant to run
one stage at a time per process.
run_stage
run_stage(project_dir, stage, on_progress=None, cancel=None, *, verbose=False, run_vacant=True, drop_scrutiny_outliers=None, do_shaps=False, use_saved_params=True)
Run one pipeline stage for a locality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_dir
|
path - like
|
The locality folder (the one containing |
required |
stage
|
str
|
One of |
required |
on_progress
|
callable
|
Receives a :class: |
None
|
cancel
|
callable
|
Returns True to request cancellation; the stage then raises
:class: |
None
|
verbose
|
bool
|
Passed through to the pipeline functions. Defaults to False. |
False
|
run_vacant
|
bool
|
Whether |
True
|
drop_scrutiny_outliers
|
bool
|
Whether sales scrutiny drops flagged sales (cluster and heuristic outliers).
Defaults to |
None
|
do_shaps
|
bool
|
Whether |
False
|
use_saved_params
|
bool
|
Whether |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Cancelled
|
If |
Source code in openavmkit/headless.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |