Repository navigation
Conversation
|
The Python 3.9 job fails in 52 existing sparse-input estimator checks (2082 other tests pass). The same 52 case IDs reproduce on both unchanged main In that environment, the Yeo-Johnson test module has 10 precision failures and 17 passing controls on main, and all 27 tests pass with the fix. The official job log is truncated and does not expose its complete dependency versions, so this is a compatible local reproduction rather than an exact copy of the CI environment. The official Python 3.9 job remains failed; no tests or CI configuration were changed to suppress it. |
A fitted
YeoJohnsonTransformerpreserves small nonzero values intransform, butinverse_transformrounds them to zero. For example, fitting on[-3, -1, 0, 1, 3]and round-tripping[-1e-20, 0, 1e-20]currently returns[0, 0, 0]. The inverse formulas lose precision when adding or subtracting 1.Use the mathematically equivalent
log1p/expm1formulas on both signs, including the lambda 0 and 2 branches. Add regressions for learned lambdas, near-zero and ordinary values, index preservation, untouched columns, and unchanged inputs.Closes #1100.
Validation on Windows with Python 3.12.14, NumPy 2.2.6, pandas 2.3.3, SciPy 1.16.3 and scikit-learn 1.7.2:
d866312874a66364c6dee3c247e69476b478395c.pytest tests: 2134 passed. The initial baseline run had three dataset-cache permission failures in addition to the 10 new regressions; those same three baseline cases pass with a writable cache containing the standard California housing dataset.flake8 feature_engine tests, changed-file isort checks andsphinx-build -W -b htmlpass. Black reports the same existing missing comma in the old test at line 126 on both versions; the production file is clean. Full mypy reports the same two existing errors inselection/shuffle_features.pyanddatetime/datetime_subtraction.py, with none in the changed production file.No other platform or dependency matrix was run. This is a numerical correction to the current pandas implementation; it does not change the separate narwhals migration in #965, whose current inverse formulas have the same cancellation.