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

   ### What changes were proposed in this pull request?
   
   Move the `predictionColumn` hook from `ClassificationModel` to 
`PredictionModel`, and use it in
   `PredictionModel.transformImpl`.
   
   The existing classification-specific overrides continue to use the same 
hook. A focused test
   verifies that the generic `PredictionModel` transform path invokes an 
overridden
   `predictionColumn`.
   
   ### Why are the changes needed?
   
   Prediction-column expression customization is useful to prediction models 
generally, not only to
   classification models. Defining the hook in `PredictionModel` lets other 
model families provide a
   native expression or a UDF that snapshots only the prediction state they 
need.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added a unit test and ran:
   
   ```
   JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 build/sbt \
     'mllib/testOnly org.apache.spark.ml.PredictorSuite' \
     'mllib/testOnly org.apache.spark.ml.classification.ClassifierSuite'
   ```
   
   ### 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]

Reply via email to