DimReducer: add prefix param + tests (v0.3.4)#12
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prefixparam toDimReducerso output columns can be named{prefix}_{i}instead of the hardcodeddim_{i}. Default is"dim", so existing behavior is unchanged (backward compatible).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.DimReducertest coverage (previously zero): default/custom prefix,get_feature_names_outparity, invalid-method validation, pandas backend, and pca/tsne/umap methods.0.3.3->0.3.4.Notes
__init__(restored + tidied into a_VALID_METHODSconstant), so this release has no API-observable behavior change beyond the additiveprefixparam and the float32 cast.feature_namesinfit, which trips sklearnclone/check_estimator. Tracked separately.Test plan
uv run pytest tests/test_feature_transformers.py— 11 passed, 6 skipped (optional deps)DimReducerdoctest — 7 attempted, 0 failedMade with Cursor