zhengruifeng opened a new pull request, #58277: URL: https://github.com/apache/spark/pull/58277
### What changes were proposed in this pull request? This PR fixes the prediction column alias in `GBTRegressionModel.transform` to use `predictionCol` and its output metadata. It also adds a regression test that verifies the transformed prediction metadata matches `transformSchema`. ### Why are the changes needed? The prediction expression was aliased with `featuresCol` and the feature column metadata. Although `withColumns` assigned the final prediction column name, its outer alias inherited the feature metadata from the inner alias. As a result, the transformed prediction column could carry vector feature metadata instead of its expected numeric prediction metadata. ### Does this PR introduce _any_ user-facing change? Yes. `GBTRegressionModel.transform` now attaches the correct numeric metadata to the prediction column. Prediction values, data types, and column names are unchanged. ### How was this patch tested? Added a regression test and ran: `./build/sbt 'mllib/testOnly org.apache.spark.ml.regression.GBTRegressorSuite'` ### 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]
