You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/09/01 15:46:04 UTC
[PR] [SPARK-59154][ML] Optimize tree classification model transform closures [spark]
zhengruifeng opened a new pull request, #58454:
URL: https://github.com/apache/spark/pull/58454
### What changes were proposed in this pull request?
This PR specializes the column-expression prediction hooks for
`DecisionTreeClassificationModel`, `RandomForestClassificationModel`, and
`GBTClassificationModel`.
The new implementations snapshot only the tree roots, tree weights, class count, loss, and
thresholds needed by each requested output column. Shared companion-object helpers perform raw
prediction and probability conversion without retaining the full model in UDF closures.
### Why are the changes needed?
The default probabilistic classifier column hooks invoke bound model methods. Their UDF closures
therefore retain the complete model and parameter graph in query plans, even though tree scoring
needs only the tree nodes and a small amount of immutable prediction state. This adds avoidable
driver memory pressure for long-lived Spark Connect servers.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
The following checks passed:
```
build/sbt mllib/compile
build/sbt mllib/scalastyle
```
No new tests were added because the existing `ProbabilisticClassifierSuite.testPredictMethods`
coverage exercises all combinations of raw-prediction, probability, and prediction columns for
all three tree classifiers.
### 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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59154][ML] Optimize decision tree model transform closures [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #58454: [SPARK-59154][ML] Optimize decision tree model transform closures
URL: https://github.com/apache/spark/pull/58454
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59154][ML] Optimize decision tree model transform closures [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #58454:
URL: https://github.com/apache/spark/pull/58454#issuecomment-5537758041
**Merge Summary:**
- merged into master https://github.com/apache/spark/commit/383c6f8f4f30171b174e00c4da3b2c308766e8a4
- merged into branch-4.x https://github.com/apache/spark/commit/99f127edf871fdc8bf1841c858ab0054074ce567
*Posted by `merge_spark_pr.py`*
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org