Skip to content

DimReducer: add prefix param + tests (v0.3.4)#12

Merged
jrosenfeld13 merged 2 commits into
mainfrom
feature/dimreducer-prefix
Jul 1, 2026
Merged

DimReducer: add prefix param + tests (v0.3.4)#12
jrosenfeld13 merged 2 commits into
mainfrom
feature/dimreducer-prefix

Conversation

@jrosenfeld13

Copy link
Copy Markdown
Contributor

Summary

  • Add a prefix param to DimReducer so output columns can be named {prefix}_{i} instead of the hardcoded dim_{i}. Default is "dim", so existing behavior is unchanged (backward compatible).
  • Cast reducer input to float32 (matches t-SNE/UMAP internals; enables cuML/GPU backends). Note: PCA on float64 inputs will produce slightly different numeric results than 0.3.3.
  • Add DimReducer test coverage (previously zero): default/custom prefix, get_feature_names_out parity, invalid-method validation, pandas backend, and pca/tsne/umap methods.
  • Trim docstrings, add a cuML drop-in note, and make the docstring examples runnable (doctest passes).
  • Bump version 0.3.3 -> 0.3.4.

Notes

  • Method validation was kept eager in __init__ (restored + tidied into a _VALID_METHODS constant), so this release has no API-observable behavior change beyond the additive prefix param and the float32 cast.
  • Pre-existing (out of scope): base-class mutates feature_names in fit, which trips sklearn clone/check_estimator. Tracked separately.

Test plan

  • uv run pytest tests/test_feature_transformers.py — 11 passed, 6 skipped (optional deps)
  • DimReducer doctest — 7 attempted, 0 failed
  • Confirm CI green on the PR

Made with Cursor

jrosenfeld13 and others added 2 commits July 1, 2026 12:51
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add tests: default/custom prefix, get_feature_names_out, invalid
  method, pandas backend, pca/tsne/umap methods
- Restore eager method validation in __init__ (single source of truth)
- Fix docstring examples to be runnable (doctest passes)
- Bump version 0.3.3 -> 0.3.4

Co-authored-by: Cursor <cursoragent@cursor.com>
@jrosenfeld13 jrosenfeld13 merged commit daeef22 into main Jul 1, 2026
3 checks passed
@jrosenfeld13 jrosenfeld13 deleted the feature/dimreducer-prefix branch July 1, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant