Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 67 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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.

Expand Down
8 changes: 7 additions & 1 deletion docs/core_concepts/config_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
```
Expand Down
40 changes: 24 additions & 16 deletions docs/developer_guide/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -186,15 +190,17 @@ 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:**

```bash
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:**

Expand Down Expand Up @@ -230,25 +236,27 @@ 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:**

```bash
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
Expand Down
6 changes: 6 additions & 0 deletions docs/developer_guide/support_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions docs/developer_guide/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| ----------------- | ---------------------- | -------------- |
Expand All @@ -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

Expand Down
13 changes: 11 additions & 2 deletions docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions docs/getting_started/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading