Skip to main content

KMDS Featurization

KMDS Featurization turns cleaned data into model-ready datasets using a configurable stage pipeline.

It is designed to be flexible:

  • works with standard cross-sectional datasets
  • supports survival analysis workflows when needed
  • keeps feature engineering and train/validation flow leakage-safe
  • resolves file anchors relative to the workspace working_dir

What it produces

The main outputs are:

  • featurized_data.csv: a consolidated engineered dataset
  • model_ready_numeric_data.csv: a numeric model-ready export for modeling

This tool also creates diagnostic artifacts such as:

  • feature_selection_knee_curve.png

How it works

The pipeline is built from stage wrappers in featurization_scripts/featurization.py. Each stage returns a DataFrame and the runner concatenates stage outputs by index.

Key ideas:

  • every row can be assigned a stable record_id
  • stages are configured in featurizer_config.yaml
  • stage output is merged horizontally to build the final dataset
  • only the final stage may intentionally add new records back into the pipeline

Survival vs. regular featurization

This repository supports two kinds of workflows:

  • regular cross-sectional featurization: one row per input record
  • survival featurization: one row per subject after flattening event or interval history

If you are doing survival analysis, read:

  • documents/survival_featurization_pipeline.md

For regular workflows, see:

  • documents/user_guide_cs_featurization.md

Quick start

Initialize a workspace config:

featurization-cli init \
  --working-dir /path/to/workspace \
  --metadata-file your_metadata.csv \
  --data-file your_cleaned_dataset.csv

Create a provisional starter config:

featurization-cli bootstrap \
  --working-dir /path/to/workspace \
  --metadata-file your_metadata.csv \
  --data-file your_cleaned_dataset.csv

Run the pipeline:

featurization-cli run --working-dir /path/to/workspace

If you want to validate survival config first, check:

  • documents/survival_featurization_pipeline.md

Testing

Run the core tests with:

pytest -q tests/test_sba_pipeline.py tests/test_survival_prep.py tests/test_survival_featurizer_pipeline.py

Notes for users

  • featurizer_config.yaml file anchors are workspace-relative.
  • absolute paths depend on your local working_dir setting.
  • stage wrappers should stay thin and use shared src/tabular/ logic.
  • survival support is a use-case extension, not a universal default.
  • documents/client_onboarding.md
  • documents/sba_pipeline_featurization.md
  • documents/config_blueprint.md
  • documents/path_coordinator_function.md
  • documents/user_guide_cs_featurization.md
  • documents/survival_featurization_pipeline.md

Package metadata API

The package exposes get_package_info() for runtime discovery and orchestration clients. It returns a metadata dictionary containing:

  • package_name: kmds-featurization
  • version: package version from featurization.__version__
  • entry_point: the CLI entry point featurization-cli
  • cli_commands: available CLI subcommands such as init, bootstrap, run, and advise
  • documentation_note: note that installed packages do not include internal docs
  • usage: a dictionary with workflow guidance and repository guide links
    • cross_sectional_guide: documents/user_guide_cs_featurization.md
    • survival_guide: documents/survival_featurization_pipeline.md
    • guidance: notes about feature selection and wide/short datasets

The package no longer ships embedded documents in the installed distribution. Use the repository's top-level documents/ folder for onboarding and implementation guidance.

Example:

from featurization import get_package_info

info = get_package_info()
print(info["version"])
print(info["cli_commands"])
print(info["usage"]["cross_sectional_guide"])

Metadata

Release files for kmds-featurization 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kmds-featurization 1.0
File Size Uploaded Provenance Actions
kmds_featurization-1.0.tar.gz 48.2 kB Without provenance Details for kmds_featurization-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kmds-featurization 1.0
File Interpreter ABI Platform Actions
kmds_featurization-1.0-py3-none-any.whl Python 3 none any Details for kmds_featurization-1.0-py3-none-any.whl

Total release size: 92.3 kB

Release files / kmds_featurization-1.0.tar.gz

Download URL kmds_featurization-1.0.tar.gz
Size 48.2 kB
Tags Source
SHA-256 checksum
How to use checksums
47e30fff3e5b889119b085b86a4f5b349ca09f6a381186d04c6a2f3e85ebf26f
BLAKE2b-256 checksum
How to use checksums
a709d44b2cca33b06c16cb8c3eac2ae37f29f36f023f033e45338404e5d94cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / kmds_featurization-1.0-py3-none-any.whl

Download URL kmds_featurization-1.0-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a02a6bb4cb0442a8198c4085b11b718b155f2ccc82dfa90f3bc40c33973a803b
BLAKE2b-256 checksum
How to use checksums
ee5c757ca1a87ebc651bc386c96caf4563ae528894ecfb44754c519739898f3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for kmds-featurization 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page