zhengruifeng opened a new pull request, #58608: URL: https://github.com/apache/spark/pull/58608
### What changes were proposed in this pull request? This PR changes `MultilayerPerceptronClassificationModel` to receive and retain its `FeedForwardModel` as a private eager value. The public `weights` accessor becomes a method backed by the feed-forward model. Training, copying, and model loading now construct the feed-forward model before constructing the classification model. It also narrows the internal `FeedForwardTopology.model` return types to `FeedForwardModel` and updates the probability test to use the public prediction API. ### Why are the changes needed? The feed-forward model is the runtime state required by every prediction operation. Constructing it up front makes that state explicit and avoids retaining a separate model-level weights field solely to lazily reconstruct the feed-forward model. The trained weights remain available through the existing public `weights` accessor and continue to be used by persistence and model copying. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - `build/sbt mllib/compile` - `build/sbt 'mllib/testOnly *MultilayerPerceptronClassifierSuite'` - `./dev/mima` - `./dev/scalastyle` ### 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: [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]
