diff --git a/CHANGELOG.md b/CHANGELOG.md index 50e1e243..8a284d22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,73 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/) and uses [Conventional Commits](https://www.conventionalcommits.org/). -Commitizen generates initial entries with `cz bump`; release notes are reviewed -and consolidated for each stable version before publication. +Release notes are maintained here by hand and reviewed before each stable release. + +## Unreleased + +Target: v2.1.1. + +### Compatibility + +- DeepTab keeps Python 3.11-3.13 and `pretab>=1.0,<2.0`. PreTab 1.1 works with + the existing preprocessing API. Upgrading from PreTab 1.0 is optional. +- Refitting with PreTab 1.1 can change results, because DeepTab places bins + with target-aware CART by default and + [PreTab 1.1](https://github.com/OpenTabular/PreTab/releases/tag/v1.1.0) + ranks CART splits differently. Fitted widths stay the same, and saved models + predict the same after the upgrade. Record the PreTab version with your + results and compare scores only within one version. +- The `mlflow`, `tracking`, and `all` extras require MLflow >=3.9,<4.0 to work + with SQLAlchemy 2.1. Update any older MLflow pin before upgrading those + extras. Core-only installs do not gain an MLflow dependency (#625). +- Mambular and MambAttention artifacts from 2.1.0 or earlier need retraining + if they used `shuffle_embeddings=True` with a CLS token or external embeddings. The old + shuffle permutation cannot be loaded with the corrected token count. + See the [Migration Guide](docs/getting_started/migration.md#saved-models-with-shuffled-embeddings) + before upgrading (#484). + +### Fixed + +#### Estimators, Training, and Persistence + +- Restore the estimator class and distribution recorded in a saved artifact, + even when `load()` is called on a different estimator class. LSS `save()` + returns the saved path, and continued training keeps fitted preprocessing + and compares array-valued distribution options by value (#548, #562, #564, #568). +- Score regressors with the weights already in memory rather than reopening + the training checkpoint. Convert low-precision prediction tensors to + `float32` before NumPy conversion (#504, #540). +- Keep sample weights aligned with training rows, share a validation split + across HPO trials, and search ResNet's boolean normalization setting as a + boolean (#492, #560, #632). +- Avoid singleton BatchNorm tails in the default training loader. Keep + contrastive anchors aligned with their pairs and skip batches too small + to form pairs (#528, #530, #578). + +#### Preprocessing and Metrics + +- Align later DataFrames by position when training inputs have no feature + names, fixing a compatibility error with PreTab 1.1. Named training + schemas still require matching names and order (#636). +- Make target-aware preprocessing work with Dirichlet target vectors without + changing the full vectors used for model training (#635). +- Correct classification probability metrics when labels are encoded or some + classes are absent from evaluation data. Fix negative binomial and Tweedie + deviance, log-normal CRPS, and the handling of column-vector targets in + negative log-likelihood (#494, #506, #509, #518, #524, #526). + +#### Architectures and Experiment Tracking + +- Make recurrent and convolutional pooling work in the forward pass. Keep + all feature tokens when shuffling embeddings and size `learned_flatten` + from the full token count. Custom sequence models can use + `embedding_layer.n_tokens` to size a flattening head (#482, #484). +- Honor `ObservabilityConfig` in LSS training and include paths and NumPy + values in lifecycle JSON. Respect `fit(enable_model_summary=False)` across + classifiers, regressors, and LSS models (#486, #500, #546). +- Respect `mlflow_log_model=False` without removing the local checkpoint or + stopping other tracking. Pass local MLflow artifact directories as file URIs, + including on Windows (#544). ## v2.1.0 (2026-10-20) diff --git a/README.md b/README.md index 1d47b844..e194b12d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,14 @@ ## What's New in v2.1 -v2.1 updates preprocessing to PreTab 1.0 and improves estimator, architecture, and persistence behavior. +DeepTab 2.1.1 fixes a PreTab 1.1 compatibility issue when you train on a NumPy +array and validate or predict with a pandas DataFrame. PreTab 1.0 remains +supported. The patch also fixes mixed-precision predictions and recurrent or +convolutional pooling, and improves model save and load behavior. See the +[Changelog](https://github.com/OpenTabular/DeepTab/blob/main/CHANGELOG.md) for +the full list. + +DeepTab 2.1.0 introduced the PreTab 1.0 integration and the following changes: - **Python support:** Python 3.11-3.13; Python 3.10 is no longer supported. Recreate older environments before upgrading. - **Dependency security:** patched Torch, setuptools, Lightning, and Accelerate requirements; native TabR dependencies now use the separate `tabr` extra on Linux and Windows. @@ -41,7 +48,7 @@ v2.1 updates preprocessing to PreTab 1.0 and improves estimator, architecture, a See the [Numerical Width Study](https://deeptab.readthedocs.io/en/latest/model_zoo/efficiency.html#numerical-width-study) for a small CPU comparison of preprocessing widths, including the protocol, runner, and raw results. -> **Upgrading?** See the [Migration Guide](https://deeptab.readthedocs.io/en/latest/getting_started/migration.html) for configuration changes and historical artifact limitations. Tested 2.0 PLE artifacts require their original dependency environment; upgrading does not convert them. +> **Upgrading?** See the [Migration Guide](https://deeptab.readthedocs.io/en/latest/getting_started/migration.html) for configuration changes and which saved models need retraining. Tested 2.0 PLE artifacts require their original dependency environment; upgrading does not convert them. ## 🏃 Quickstart @@ -156,7 +163,7 @@ pip install mamba-ssm > **Optional dependencies:** Logging, tracking, and TabR retrieval dependencies are loaded lazily. The default installation does not include `faiss-cpu` or `delu`. The `all` extra bundles observability backends only; combine extras explicitly, for example `deeptab[all,tabr]`, on a supported native platform. -> **Requirements:** Python 3.11-3.13, PyTorch >=2.13,<2.15, PreTab 1.x, Lightning >=2.6.6,<3.0. See the [Support Matrix](https://deeptab.readthedocs.io/en/latest/developer_guide/support_matrix.html) for dependency and platform constraints. +> **Requirements:** Python 3.11-3.13, PyTorch >=2.13,<2.15, PreTab >=1.0,<2.0, Lightning >=2.6.6,<3.0. See the [Support Matrix](https://deeptab.readthedocs.io/en/latest/developer_guide/support_matrix.html) for dependency and platform constraints. > **macOS:** Python 3.13 PyTorch wheels are available for Apple Silicon. Intel Macs are outside the CI matrix. Native TabR is unsupported on Apple Silicon because Torch and the PyPI FAISS build load conflicting OpenMP runtimes; use Linux or Windows for TabR. diff --git a/docs/core_concepts/config_system.md b/docs/core_concepts/config_system.md index eba318d5..603e2de1 100644 --- a/docs/core_concepts/config_system.md +++ b/docs/core_concepts/config_system.md @@ -137,7 +137,9 @@ An inherited field does not imply identical behavior in every architecture. For ## Preprocessing Config -`PreprocessingConfig` is a thin wrapper around the fields PreTab 1.0's `Preprocessor` accepts. Fields set to `None` are omitted, leaving the preprocessor's own default in effect. +`PreprocessingConfig` forwards supported settings to PreTab's `Preprocessor`. +The same configuration API works with PreTab 1.0 and 1.1 in DeepTab 2.1.1. +Fields set to `None` are omitted, leaving the preprocessor's own default in effect. ```python from deeptab.configs import PreprocessingConfig @@ -169,6 +171,10 @@ Embedding width is not a `PreprocessingConfig` field in the current API. It is c `PreprocessingConfig` only forwards these fields; the transforms themselves live in PreTab. For the full catalogue of representations and what each one does mathematically, see [PreTab's documentation](https://pretab.readthedocs.io/en/latest/index.html), in particular the [representations overview](https://pretab.readthedocs.io/en/latest/representations/overview.html) and [API reference](https://pretab.readthedocs.io/en/latest/api/index.html). +```{note} +Because the transforms live in PreTab, the installed PreTab version can change fitted results. DeepTab's default preprocessing places bins with target-aware CART (`target_aware=True`, `placement_strategy="cart"`). [PreTab 1.1](https://github.com/OpenTabular/PreTab/releases/tag/v1.1.0) ranks CART splits differently from PreTab 1.0, so refitting the same data with the same seed can move some bin boundaries and change scores. In the DeepTab 2.1.1 checks, effective widths did not change, classification scores moved, and regression with uniform B-splines was identical. Saved models keep their fitted preprocessing, so an artifact trained with PreTab 1.0 predicts the same after you upgrade. Record the PreTab version with your results and compare scores only between runs that used the same version. +``` + ```{note} Earlier DeepTab releases used a different set of field names, for example `numerical_preprocessing` instead of `numerical_method`, or `scaling_strategy` instead of `scaling`. These legacy names still work: passing one on its own resolves to the matching field above and emits a `ConfigWarning` naming the replacement, while passing both a legacy name and its canonical replacement with conflicting values raises `IncompatibleParamsError`. A few legacy names have no direct replacement (`spline_implementation` is one) and raise an actionable error immediately rather than being silently accepted. ``` diff --git a/docs/developer_guide/release.md b/docs/developer_guide/release.md index 16eb3b5b..47b7d97f 100644 --- a/docs/developer_guide/release.md +++ b/docs/developer_guide/release.md @@ -146,19 +146,23 @@ checks do not replace the hosted platform and dependency matrices. ## 6. Version bump -The version bump is driven entirely by [Commitizen](https://commitizen-tools.github.io/commitizen/). The increment (MAJOR / MINOR / PATCH) is inferred from the conventional-commit messages since the last tag, the version in `pyproject.toml` is updated, and the matching `CHANGELOG.md` section is generated and committed with a tag. The current recipes create lightweight tags unless `--annotated-tag` is supplied. +[Commitizen](https://commitizen-tools.github.io/commitizen/) infers the increment +(MAJOR / MINOR / PATCH) from conventional commits since the last tag. It updates +the version in `pyproject.toml` and creates a commit and tag. It does not edit +`CHANGELOG.md`. The recipes create lightweight tags unless `--annotated-tag` +is supplied. ```{important} -Always run `--dry-run` first and review the proposed version and CHANGELOG entries carefully before applying the bump. +Run `--dry-run` first and check the proposed version. Review the changelog +separately before applying the bump. ``` -The following Commitizen settings in `pyproject.toml` shape this behaviour: +The release recipes rely on these Commitizen settings in `pyproject.toml`: -| Setting | Value | Effect | -| ---------------------------- | ------ | --------------------------------------------------------------------------------------------- | -| `prerelease_offset` | `1` | Prereleases start at `rc1` (not the default `rc0`) | -| `changelog_merge_prerelease` | `true` | On the stable bump, all `rcN` CHANGELOG sections are rolled up into a single `vX.Y.Z` section | -| `update_changelog_on_bump` | `true` | `CHANGELOG.md` is regenerated automatically on every bump | +| Setting | Value | Effect | +| -------------------------- | ------- | -------------------------------------------- | +| `prerelease_offset` | `1` | Prereleases start at `rc1` instead of `rc0`. | +| `update_changelog_on_bump` | `false` | Maintainers edit `CHANGELOG.md` by hand. | The bump commands are wrapped in `just` recipes so the correct Commitizen flags are applied consistently: @@ -186,7 +190,8 @@ Commitizen can only infer the target version from commits. For a **major** relea just bump-rc-preview ``` -Confirm the proposed tag (e.g. `v2.0.0rc1`) and that the CHANGELOG entries are complete and correctly classified. +Confirm the proposed tag (e.g. `v2.0.0rc1`). Make sure the `Unreleased` section +of `CHANGELOG.md` reflects the candidate before applying the bump. **Step 2, apply:** @@ -194,7 +199,8 @@ Confirm the proposed tag (e.g. `v2.0.0rc1`) and that the CHANGELOG entries are c just bump-rc ``` -This updates `version` in `pyproject.toml`, appends the `vX.Y.ZrcN` section to `CHANGELOG.md`, creates the `bump:` commit, and creates the `vX.Y.ZrcN` tag locally. +This updates `version` in `pyproject.toml` and creates the `bump:` commit and +local `vX.Y.ZrcN` tag. **Step 3, review and push only the RC bump commit:** @@ -230,14 +236,17 @@ reviewed tag works with either tag type and avoids publishing unrelated tags. ### 6b. Stable bump -When all RCs are approved, cut the final stable version with the plain `bump` recipes. Because `changelog_merge_prerelease = true`, the intermediate `rcN` sections are merged into a single complete `vX.Y.Z` CHANGELOG section, so end users see the full release notes in one place. +When all RCs are approved, finalize the changelog in a commit on the release +branch. Replace `Unreleased` with the stable version and release date, then +cut the final version with the plain `bump` recipes. ```bash just bump-preview # append --increment MAJOR if needed just bump ``` -This updates `pyproject.toml`, regenerates `CHANGELOG.md` (with prereleases merged), and creates the `bump:` commit plus the `vX.Y.Z` tag. +This updates `pyproject.toml` and creates the `bump:` commit and local +`vX.Y.Z` tag. **Review the bump commit:** @@ -245,10 +254,9 @@ This updates `pyproject.toml`, regenerates `CHANGELOG.md` (with prereleases merg git show HEAD ``` -Check that `pyproject.toml` shows the correct version and that `CHANGELOG.md` -reads cleanly. Manually amend duplicate entries if present, then push the -branch. Push the stable tag only after the release PR is merged, as described -in step 9: +Check that `pyproject.toml` and `CHANGELOG.md` show the same release version +before pushing the branch. Push the stable tag only after the release PR is +merged, as described in step 9: ```bash git push origin release/vX.Y.Z diff --git a/docs/developer_guide/support_matrix.md b/docs/developer_guide/support_matrix.md index 657eecf7..ba6ea256 100644 --- a/docs/developer_guide/support_matrix.md +++ b/docs/developer_guide/support_matrix.md @@ -38,6 +38,12 @@ The authoritative version constraints live in [`pyproject.toml`](https://github. - **PyTorch, Lightning, NumPy, pandas, scikit-learn, torchmetrics, scipy, PreTab** are core dependencies with declared version ranges; `poetry.lock` records exact development versions. NumPy 1.x is **not** supported. - **delu, faiss-cpu** are model-specific dependencies installed only by the `tabr` extra. The default install and the `all` observability bundle exclude them. +DeepTab 2.1.1 declares `pretab>=1.0,<2.0` and works with PreTab 1.0 and 1.1 +through the existing preprocessing API, without adopting PreTab 1.1's new +schema-based pipeline. The development lock uses PreTab 1.0.0 for reproducible +locked tests. It does not pin `pip install deeptab`: pip and the dependency +endpoint jobs resolve PreTab from the wheel's metadata. + DeepTab targets a tested support window, informed by [SPEC 0](https://scientific-python.org/specs/spec-0000/) used by the broader scientific Python ecosystem: - **Python**: maintain a three-minor window, currently 3.11-3.13. A new upstream release is not admitted automatically: compatible dependencies and release checks must pass first. Review older versions near upstream end of life, no earlier than 42 months after release, and announce removals in the release notes. diff --git a/docs/developer_guide/versioning.md b/docs/developer_guide/versioning.md index 7353a173..2deaf22d 100644 --- a/docs/developer_guide/versioning.md +++ b/docs/developer_guide/versioning.md @@ -85,7 +85,10 @@ The `commit-msg` pre-commit hook validates every commit message against the conv ## Bumping the version -Version bumps are driven by [commitizen](https://commitizen-tools.github.io/commitizen/), wrapped in `just` recipes. Preview first with the `-preview` (dry-run) variant, then apply. Each apply recipe updates `version` in `pyproject.toml`, appends to `CHANGELOG.md`, and creates the bump commit and tag. +Version bumps use [Commitizen](https://commitizen-tools.github.io/commitizen/) +through `just` recipes. Preview first with the `-preview` (dry-run) variant, +then apply. Each apply recipe updates `version` in `pyproject.toml` and +creates the bump commit and tag. It leaves `CHANGELOG.md` unchanged. | Goal | Preview | Apply | | ----------------- | ---------------------- | -------------- | @@ -96,7 +99,10 @@ The next version is inferred from the conventional commits since the last tag. T ## Changelog -`CHANGELOG.md` at the repository root is the authoritative changelog, updated automatically by the bump recipes. Changes are grouped under their commit types (`feat`, `fix`, `perf`, ...) with the subject line of every matching commit since the previous release. +Maintain the root `CHANGELOG.md` by hand. Summarize user-facing changes and +upgrade considerations under `Unreleased`, then give the section its version +and date when preparing the stable release. See the +[release process](release.md). ## Tags diff --git a/docs/getting_started/installation.md b/docs/getting_started/installation.md index 7898ae05..5a7c1942 100644 --- a/docs/getting_started/installation.md +++ b/docs/getting_started/installation.md @@ -10,13 +10,15 @@ pip install deeptab ``` -This installs DeepTab with its core dependencies, including PyTorch, Lightning, and preprocessing tools. Logging, tracking, and native TabR retrieval use separate extras. +This installs DeepTab with its core dependencies, including PyTorch, Lightning, +and PreTab for preprocessing. Logging, tracking, and native TabR retrieval use +separate extras. **Verify installation:** ```python import deeptab -print(deeptab.__version__) # e.g., "2.0.0" +print(deeptab.__version__) ``` ## Supported Platforms @@ -69,6 +71,13 @@ Lightning >=2.6.6,<3, Accelerate >=1.15,<2, and setuptools >=83,<84. The patched dependency floors replace older compatibility pins with reported vulnerabilities. Do not force older versions with `--no-deps`. +DeepTab 2.1.1 uses `pretab>=1.0,<2.0`. PreTab 1.1 works with the existing +preprocessing API, and you do not need to upgrade an environment that already +uses PreTab 1.0. If you train on an array and later pass a DataFrame for +validation, prediction, or continued training, keep the same feature order: +DeepTab matches columns by position when the training input has no feature names. +Training with named columns still requires matching names and order. + TensorBoard extras require >=2.21,<3. Earlier versions can fail hyperparameter event writing with NumPy 2 or import the removed `pkg_resources` module with patched setuptools. diff --git a/docs/getting_started/migration.md b/docs/getting_started/migration.md index d8ccf7eb..a1002b4d 100644 --- a/docs/getting_started/migration.md +++ b/docs/getting_started/migration.md @@ -80,6 +80,16 @@ for the authoritative, version-accurate list. ## Before you upgrade +### Saved models with shuffled embeddings + +```{warning} +Retrain Mambular or MambAttention models saved with DeepTab 2.1.0 or earlier +if they used `shuffle_embeddings=True` together with a CLS token or external +embeddings. Those artifacts store a feature permutation that is too short +for DeepTab 2.1.1 to load. Refit with the original training data and save a +new artifact, or keep the original environment if you need to run the old model. +``` + ### Retrieval artifacts without candidate data TabR and experimental ModernNCA artifacts now retain the transformed training diff --git a/docs/homepage.md b/docs/homepage.md index 9846670a..9d0cedd7 100644 --- a/docs/homepage.md +++ b/docs/homepage.md @@ -26,7 +26,9 @@ probabilities = model.predict_proba(X_test) pip install deeptab ``` -DeepTab requires Python 3.11-3.13 and installs PyTorch automatically. See [Installation](getting_started/installation) for GPU setup and the optional Mamba CUDA kernels. +DeepTab requires Python 3.11-3.13 and installs PyTorch and PreTab automatically. +See [Installation](getting_started/installation) for dependency compatibility, +GPU setup, and the optional Mamba CUDA kernels. Logging, experiment tracking, and native TabR retrieval are optional. The `all` extra includes observability backends only; use `deeptab[tabr]` for @@ -34,14 +36,21 @@ TabR, or `deeptab[all,tabr]` for both, on Linux or Windows. Native TabR is unsupported on Apple Silicon because Torch and FAISS load conflicting OpenMP runtimes. See the [Support Matrix](developer_guide/support_matrix). -For version-specific changes, see the +## What's new in 2.1.1 + +You can use PreTab 1.1 with the same DeepTab preprocessing configuration or +stay on PreTab 1.0. This patch fixes a column-matching error when you train on +a NumPy array and later pass a pandas DataFrame. It also improves model +save and load behavior, scoring, and experiment tracking. + +For the full list of changes, see the [Changelog](https://github.com/OpenTabular/DeepTab/blob/main/CHANGELOG.md) and [GitHub Releases](https://github.com/OpenTabular/DeepTab/releases). ```{important} See the [Migration Guide](getting_started/migration) for configuration changes and -historical artifact limitations. Tested 2.0 PLE artifacts require their original -dependency environment; upgrading does not convert them. +which saved models need retraining. Tested 2.0 PLE artifacts require their +original dependency environment; upgrading does not convert them. ``` ## v2.0 Background and Migration diff --git a/docs/model_zoo/efficiency.md b/docs/model_zoo/efficiency.md index ffea5887..f4917e55 100644 --- a/docs/model_zoo/efficiency.md +++ b/docs/model_zoo/efficiency.md @@ -250,6 +250,14 @@ process RSS depend on the environment; do not pool these measurements with older runs or use them as native retrieval, accelerator or security evidence. ``` +```{note} +These measurements used PreTab 1.0.0. PreTab 1.1 ranks target-aware CART splits +differently, so rerunning the classification cases with PreTab 1.1 can give +different accuracy and AUROC at the same effective widths. The regression cases +use uniform B-splines, which do not use the target, and gave identical scores +under both PreTab versions in the DeepTab 2.1.1 checks. +``` + ## Reporting Template Use this compact template in experiment notes or pull requests: diff --git a/justfile b/justfile index 4c8788c8..f283dc3f 100644 --- a/justfile +++ b/justfile @@ -104,7 +104,7 @@ audit: bump-preview *args: poetry run cz bump --dry-run {{ args }} -# apply the next stable version bump (updates version, CHANGELOG, commit, and tag) +# apply the next stable version bump (updates version and creates a commit and tag) bump *args: poetry run cz bump {{ args }} @@ -112,6 +112,6 @@ bump *args: bump-rc-preview *args: poetry run cz bump --prerelease rc --dry-run {{ args }} -# apply the next release-candidate bump (rcN; updates version, CHANGELOG, commit, and tag) +# apply the next release-candidate bump (updates version and creates an rcN commit and tag) bump-rc *args: poetry run cz bump --prerelease rc {{ args }} diff --git a/pyproject.toml b/pyproject.toml index c94a3fda..db816eef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "deeptab" -version = "2.1.0" +version = "2.1.1rc1" description = "Tabular deep learning made simple: a scikit-learn compatible model zoo built on PyTorch and Lightning." authors = [ { name = "Anton Thielmann" },