Skip to content

[ML] Convert encodeIds flag in TreeEncoder to configuration property - #806

Open
AliRana30 wants to merge 1 commit into
apache:mainfrom
AliRana30:fix/ml-tree-encoder-encode-ids-config-776
Open

[ML] Convert encodeIds flag in TreeEncoder to configuration property#806
AliRana30 wants to merge 1 commit into
apache:mainfrom
AliRana30:fix/ml-tree-encoder-encode-ids-config-776

Conversation

@AliRana30

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Configurable ID Encoding: Replaced the hardcoded final boolean encodeIds = false; in TreeEncoder with wayang.ml.encoding.encode-ids (defaulting to false, with shorthand wayang.ml.encode-ids supported).
  • TreeEncoder Enhancements: Added TreeEncoder(mappings, configuration) constructor, getter/setter for configuration, and overloaded encode methods that resolve encodeIds from OptimizationContext or local configuration.
  • Default Properties: Loaded wayang-ml-defaults.properties in MachineLearning.plugin().setProperties(Configuration) and declared wayang.ml.encoding.encode-ids = false.
  • Unit Tests: Added test cases in TreeEncoderTest verifying default behavior, enabled ID encoding via configuration, and plugin properties loading.

Closes #776.

Copilot AI lite review requested due to automatic review settings September 6, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

convert to config

2 participants