zhengruifeng opened a new pull request, #58691: URL: https://github.com/apache/spark/pull/58691
### What changes were proposed in this pull request? This pull request adds `TreeEnsembleModel.predict` overloads that accept tree models directly. It reuses the helper for GBT classification, GBT regression, and random forest regression prediction. Random forest classification keeps its separate class-distribution aggregation. ### Why are the changes needed? The affected models duplicate scalar tree prediction loops. Centralizing those loops makes the prediction implementations consistent and avoids allocating root-node or tree-weight arrays when predicting directly from a model. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? No new tests were added because this is a behavior-preserving refactor of prediction paths already covered by the existing GBT and random forest suites. The patch passed `git diff --check`, changed-file line-length checks, and changed-file non-ASCII checks. Unit tests were not run locally. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI 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]
