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/08/25 10:01:48 UTC

[PR] [MINOR][ML] Fix prediction column metadata in GBTRegressionModel [spark]

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: 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-58994][ML] Fix prediction column metadata in GBTRegressionModel [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #58277: [SPARK-58994][ML] Fix prediction column metadata in GBTRegressionModel
URL: https://github.com/apache/spark/pull/58277


-- 
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-58994][ML] Fix prediction column metadata in GBTRegressionModel [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #58277:
URL: https://github.com/apache/spark/pull/58277#issuecomment-5418939085

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/0ab7b7b1468dbb50b8718a1b421042a150ec8708
   - merged into branch-4.x https://github.com/apache/spark/commit/1fba3305616232b3878cf4dd9a63cd5a194c2d7f
   - merged into branch-4.3 https://github.com/apache/spark/commit/360428a5e8241eef71e4daf145cb96b8bddce16f
   - merged into branch-4.2 https://github.com/apache/spark/commit/36f7c715d88acabbc4635ed6bd55713202b633a7
   - merged into branch-4.1 https://github.com/apache/spark/commit/743271a26fc496e004d778943f9b7fd80660ba60
   - merged into branch-4.0 https://github.com/apache/spark/commit/6fed2974428bfc4c91d483b3f7d9038f46adafc9
   
   *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


Re: [PR] [SPARK-58994][ML] Fix prediction column metadata in GBTRegressionModel [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58277:
URL: https://github.com/apache/spark/pull/58277#issuecomment-5416507499

   Thank you @zhengruifeng!


-- 
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