[SYSTEMDS-3863] Add PowerTransformer built-in functions - #2499
Open
WenliangCao wants to merge 8 commits into
Open
[SYSTEMDS-3863] Add PowerTransformer built-in functions#2499WenliangCao wants to merge 8 commits into
WenliangCao wants to merge 8 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2499 +/- ##
============================================
- Coverage 71.47% 71.44% -0.04%
+ Complexity 48883 48858 -25
============================================
Files 1573 1573
Lines 189238 189240 +2
Branches 37128 37128
============================================
- Hits 135261 135200 -61
- Misses 43530 43581 +51
- Partials 10447 10459 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add two DML builtins for the midterm PowerTransformer prototype: - powerTransform.dml estimates one Yeo-Johnson lambda per input column, uses lambda = 1 for constant columns, and applies the transform. - powerTransformApply.dml applies the Yeo-Johnson transform with supplied per-column lambdas. Register both builtins so they can be resolved by SystemDS. Add powerTransformSmokeTest.dml to verify: - powerTransformApply with lambda = 1 behaves as identity - powerTransform returns output dimensions matching the input - one lambda is returned per input column - constant columns use lambda = 1 - transformed output and lambdas do not contain NaN or Inf The smoke test passes with: ./bin/systemds src/test/scripts/functions/builtin/powerTransformSmokeTest.dml
Add a focused PowerTransformApply test that compares the DML builtin against
an independent R reference implementation.
The test adds:
- powerTransformApply.dml as a small DML wrapper around the registered builtin
- powerTransformApply.R as the reference Yeo-Johnson apply implementation
- BuiltinPowerTransformTest.java to run the DML and R scripts and compare Y
The test covers the key apply branches with fixed lambdas:
- lambda = 0 for the positive log branch
- lambda = 1 for the identity-style middle case
- lambda = 2 for the negative log branch
Also translate the remaining PowerTransformer comments from Chinese to English
in the prototype DML files.
Verified with:
Rscript -e 'parse(file="src/test/scripts/functions/builtin/powerTransformApply.R"); cat("R syntax OK\n")'
./bin/systemds src/test/scripts/functions/builtin/powerTransformSmokeTest.dml
mvn -Dtest=BuiltinPowerTransformTest test
WenliangCao
force-pushed
the
systemds-3863-power-transformer
branch
from
August 2, 2026 21:16
130c741 to
753c5a0
Compare
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
This pull request adds PowerTransformer built-ins with separate fit and apply workflows. The implementation supports Yeo-Johnson and Box-Cox transformations, per-column parameter estimation, optional standardization, and reuse of fitted parameters on new data.
Yeo-Johnson is the default method and supports mixed-sign inputs. Box-Cox is available for strictly positive inputs.
API
powerTransformestimates one lambda per column and optionally standardizes the transformed columns.powerTransformApplyreuses the fitted lambdas, means, and scales without re-estimation.Implementation
powerTransform.dmlfor fitting and transforming feature matrices.powerTransformApply.dmlfor applying fitted transformations.[-2, 2]as an initial bracket and expand it when necessary, allowing the optimum to lie outside the initial interval.Validation
mvn -Dtest=BuiltinPowerTransformTest testThe tests cover:
[-2, 2]interval;Numerical outputs are compared with independent R reference implementations.
Documentation
User-facing signatures, arguments, return values, input requirements, and examples are documented in
docs/site/builtins-reference.md.Experiments
The reproducible evaluation compares no scaling, standard scaling, robust scaling, Yeo-Johnson, and Box-Cox on nine public datasets. Each experiment uses the fixed seeds
13,37,73,101, and149.n_init=20)Supervised tasks use 80/20 train/test splits; classification is stratified and Parkinsons Telemonitoring uses subject-level group splits. Each transformation is fitted on training data and applied to test data. Clustering uses the full dataset.
The table reports the mean primary metric over five runs. A dash indicates that Box-Cox is not applicable because the feature matrix contains non-positive values.
Power transformations rank first or tie for first on four of the nine datasets. Representative results include:
0.6486with standard scaling to0.6114.0.9618.0.7759.0.5330, compared with0.1873for standard scaling.Reproducible artifacts
Limitations
The downstream effect of preprocessing is dataset- and estimator-dependent. The evaluation uses fixed distance-based estimators, three datasets per task, and no hyperparameter search or statistical significance test. The results therefore demonstrate practical cases where power transformations help, rather than universal superiority over other preprocessing methods.
Related issue
SYSTEMDS-3863