Skip to content

mapi_steps

This package has the built-in core.* steps. For the settings of each step, read the generated steps catalog.

Built-in preprocessing steps for modeling-api (core.*).

Every step implements the :class:mapi_sdk.steps.Step contract and exports static JSON (settings schema, templated :class:~mapi_spec.effects.SchemaEffect, context need) so the control plane can validate specs without importing this package. Steps are discovered through the mapi.steps entry point (:func:builtin_steps); :func:registry returns a ready :class:~mapi_sdk.registry.Registry, and python -m mapi_steps.catalog prints the catalog JSON.

========== =========================================================================== Reshape resample, count_events, filter_coords, to_long, to_padded, stack, unstack Value fx_convert, mean_scale, max_abs_scale, standardize, log1p, logit, impute, replace_sentinel, clip Feature fourier, trend, calendar, holidays, lag, lag_tensor, one_hot, encode_levels, missing_indicator, formula Precompute adstock, saturation (point models) Split time_holdout, as_of, leave_group_out, last_per_group, mask_block (:mod:mapi_steps.splits; chosen in data.split, applied by the harness) ========== ===========================================================================

registry

registry(base: Registry | None = None) -> Registry

A registry holding the built-in steps (added to a copy of base when given).

builtin_steps

builtin_steps() -> list[type[Step[Any, Any]]]

Every built-in step class (the mapi.steps entry point).

Catalog export

Static catalog export: python -m mapi_steps.catalog [--splits] [--out FILE].

Prints the :class:mapi_spec.catalog.Catalog JSON of every built-in step (settings JSON Schema, templated SchemaEffect, context need, kind, flags). Runner images generate it at build time; the control plane loads it to validate specs without importing step code. --splits adds the split catalog under a separate splits key (not part of Catalog). The same JSON ships with the package as mapi_steps/catalog.json.

catalog

catalog() -> Catalog

The built-in step catalog.

catalog_json

catalog_json(
    *, splits: bool = False, indent: int | None = 2
) -> str

Deterministic JSON text of the catalog (optionally with the split catalog).

shipped_catalog

shipped_catalog() -> Catalog

The catalog JSON shipped inside the package (regenerated by the build).

Splits

The seven built-in train/holdout splits (plan §4.1 "Split" group; v0.14 adds column and stratified).

Splits are not pipeline steps: a spec chooses one in data.split and the harness applies it at the split stage (:func:mapi_sdk.split.split_dataset), after the stateless prefix. This module gives each split kind a catalog identity (core.<kind>@1.0.0) with its settings schema and plain-language summaries for pickers and docs, plus a direct :meth:SplitStrategy.split for notebooks and tests.

======================== ==================================================================== core.time_holdout hold out the last last periods / a fraction / after a label core.as_of train up to and including as_of; optional gap periods core.leave_group_out hold out whole groups (explicit groups or n random ones) core.last_per_group last last rows of each group with at least min_len rows core.mask_block random blocks over dims covering fraction of the cells core.column the rows whose column value is in holdout (a fixed split) core.stratified a random fraction of the rows of each level of by ======================== ====================================================================

split_catalog

split_catalog() -> list[SplitCatalogEntry]

Catalog entries for every split kind.