zhengruifeng opened a new pull request, #57322:
URL: https://github.com/apache/spark/pull/57322

   ### What changes were proposed in this pull request?
   
   This patch adds `estimateMatadataSize` to the custom size estimates for 
`DecisionTreeClassificationModel`, `GBTClassificationModel`, and 
`RandomForestClassificationModel`. Their existing estimates count only learned 
tree nodes.
   
   ### Why are the changes needed?
   
   Spark Connect uses `Model.estimatedSize` for server-side ML cache 
accounting. These three custom overrides omitted the models' parameter maps and 
UID, unlike the other custom model estimators. Including the existing metadata 
estimate makes their cache accounting include both model configuration and 
learned tree state.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. For Spark Connect ML cache memory control, the reported model size and 
cache-limit accounting for these classifier models now include parameter 
metadata.
   
   ### How was this patch tested?
   
   `git diff --check` passed. I attempted to run:
   
   ```bash
   build/sbt 'mllib/testOnly 
org.apache.spark.ml.classification.DecisionTreeClassifierSuite 
org.apache.spark.ml.classification.GBTClassifierSuite 
org.apache.spark.ml.classification.RandomForestClassifierSuite'
   ```
   
   The suites did not start because this environment uses Java 11; the build 
requires Java 17.0.11 or later. No tests were added for this focused change.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to