MODULE REFERENCE
local
anomx.execution.localInspectable local experiments with chronological evaluation and Matplotlib.
This module has no platform, job-worker, Darts, or database dependency. Models remain responsible for fitting and inference; the executor records the split, metrics, timings, and outputs of a local experiment.
LocalExecutor
LocalExecutor(*, verbose: bool = True)Run and inspect local models with a deliberately small execution contract.
forecast fits a model on a chronological training prefix and predicts the untouched suffix. fit_predict supports reconstruction and representation models on explicitly supplied train/test arrays or tables. Transformers fit on training data only. No platform service is required.
| Parameter | Type | Default |
|---|---|---|
verbosekeyword only | bool | True |
Members
forecastmethod
forecast(model: Any, series: TimeSeries, *, horizon: int | None = None, train_fraction: float = 0.8, transformer: Any = None, metrics: Mapping[str, Callable[..., Any]] | None = None, name: str | None = None) -> LocalResultFit and evaluate a deterministic model on a chronological holdout.
model implements fit(TimeSeries) and predict(n). horizon selects the test suffix; otherwise train_fraction chooses the split. Optional transformers implement fit_transform/transform/inverse_transform; metrics and saved predictions use the original data scale.
| Parameter | Type | Default |
|---|---|---|
model | Any | required |
series | TimeSeries | required |
horizonkeyword only | int | None | None |
train_fractionkeyword only | float | 0.8 |
transformerkeyword only | Any | None |
metricskeyword only | Mapping[str, Callable[..., Any]] | None | None |
namekeyword only | str | None | None |
Returns LocalResult
fit_predictmethod
fit_predict(model: Any, train: Any, test: Any, *, family: str = 'reconstruction', name: str | None = None, metrics: Mapping[str, Callable[..., Any]] | None = None) -> LocalResultFit an array/table model and inspect held-out reconstructions or representations.
GenericModel can adapt sklearn estimators, callables, and PyTorch modules. For representation models supply metrics explicitly if desired; embedding coordinates are not compared to observation values as reconstruction errors.
| Parameter | Type | Default |
|---|---|---|
model | Any | required |
train | Any | required |
test | Any | required |
familykeyword only | str | 'reconstruction' |
namekeyword only | str | None | None |
metricskeyword only | Mapping[str, Callable[..., Any]] | None | None |
Returns LocalResult
LocalResult
LocalResult(name: str, family: str, train: Any, test: Any, prediction: Any, metrics: dict[str, float] = <factory: dict>, timings: dict[str, float] = <factory: dict>, metadata: dict[str, Any] = <factory: dict>)One experiment's observations, predictions, metrics, and provenance.
prediction is a forecast, reconstruction, embedding, or score depending on family. Representation outputs need not share observation features; the executor only calculates default error metrics for forecasting and reconstruction. plot() returns ordinary Matplotlib axes and save() writes portable CSV/JSON, never executable model pickle files.
| Parameter | Type | Default |
|---|---|---|
name | str | required |
family | str | required |
train | Any | required |
test | Any | required |
prediction | Any | required |
metrics | dict[str, float] | <factory: dict> |
timings | dict[str, float] | <factory: dict> |
metadata | dict[str, Any] | <factory: dict> |
Members
nameattribute
name: strfamilyattribute
family: strtrainattribute
train: Anytestattribute
test: Anypredictionattribute
prediction: Anymetricsattribute
metrics: dict[str, float] = field(default_factory=dict)timingsattribute
timings: dict[str, float] = field(default_factory=dict)metadataattribute
metadata: dict[str, Any] = field(default_factory=dict)plotmethod
plot(*, ax: Any = None, history: int = 100, max_components: int = 4, **kwargs: Any) -> AnyPlot a forecast/reconstruction against observations, or learned outputs.
history limits the training context shown before the held-out data. Pass ax to compose with existing Matplotlib figures. For multivariate output each component is rendered separately with a distinct label.
| Parameter | Type | Default |
|---|---|---|
axkeyword only | Any | None |
historykeyword only | int | 100 |
max_componentskeyword only | int | 4 |
**kwargs | Any | — |
Returns Any
savemethod
save(directory: str | Path, *, plot: bool = False) -> PathSave a receipt and tables to a dedicated local directory.
Existing filenames in this directory are replaced deliberately. Model objects and training data are not serialized; receipts include test and prediction data plus the split metadata needed to inspect the run.
| Parameter | Type | Default |
|---|---|---|
directory | str | Path | required |
plotkeyword only | bool | False |
Returns Path