[SYSTEMDS-3863] Add PowerTransformer built-in functions#2499
Open
WenliangCao wants to merge 2 commits into
Open
[SYSTEMDS-3863] Add PowerTransformer built-in functions#2499WenliangCao wants to merge 2 commits into
WenliangCao wants to merge 2 commits into
Conversation
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
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 introduces an initial implementation of the PowerTransformer built-in functions in Apache SystemDS.
The implementation follows a fit-and-apply structure, with separate functions for estimating transformation parameters and applying the transformation to new data.
Changes
powerTransform.dmlfor estimating column-wise transformation parameters.powerTransformApply.dmlfor applying the transformation with previously estimated parameters.Testing
The implementation was tested with:
mvn -Dtest=BuiltinPowerTransformTest testTest result:
The test workflow performs the following steps:
Current Status
The current implementation establishes the main transformation pipeline and verifies the numerical correctness of the Yeo-Johnson transformation.
The following components are currently available:
Current Limitations
Future Work
Related Issue
SYSTEMDS-3863