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.

Recommended documents

  • 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"])

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kmds_featurization-0.8.2.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kmds_featurization-0.8.2-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file kmds_featurization-0.8.2.tar.gz.

File metadata

  • Download URL: kmds_featurization-0.8.2.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kmds_featurization-0.8.2.tar.gz
Algorithm Hash digest
SHA256 0639a27910598c19b49d8c3c4cc6633fa4a0c7a505400250c82659682e49b9f0
MD5 53022fe4c8523836a06b3e70128d46b6
BLAKE2b-256 c38dcaf4cda582df840e25cb0d3aea100eb12eefb72a77f38ec6aa3b3264f44e

See more details on using hashes here.

File details

Details for the file kmds_featurization-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: kmds_featurization-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kmds_featurization-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ae23b1e3c91f44c5ca99883250758d8eb14629d9561e9b2b725c966c421dc2dd
MD5 c031aded3a24bf60c52a82bf2c763b8e
BLAKE2b-256 f05459c6ad86b9ff98eb9f59e287cc35c39fd96b11468694d76211fc64bf2f51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page