HyukjinKwon opened a new pull request, #734:
URL: https://github.com/apache/spark-connect-rust/pull/734

   ### What changes were proposed in this pull request?
   
   This is a follow-up of #686 (SPARK-61698), found while reviewing the last 50 
commits. #732 replayed every persistence entry of the classification goldens, 
and found that the Rust API can't load three estimators the way PySpark can.
   
   PySpark loads every estimator with `X.load(path)`, which over Spark Connect 
is one ML Read of the estimator. The Rust API had typed loads for the 
LogisticRegression, LinearSVC and tree estimators and for every classification 
model, but none for the `NaiveBayes`, `MultilayerPerceptronClassifier` and 
`FMClassifier` estimators. Those could be loaded only as generic stages, which 
read the metadata with a DataFrame query and give no typed estimator.
   
   This PR adds `NaiveBayes::load`, `MultilayerPerceptronClassifier::load` and 
`FMClassifier::load`. Each does one ML Read and returns the typed estimator 
with the saved uid and params, as `LogisticRegression::load` does. 
`docs/compatibility.md` mentions them.
   
   ### Why are the changes needed?
   
   Loading a saved estimator is part of the pyspark.ml API, and these were the 
only Rust estimators without a typed load.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, the three loads are new in the Rust API. The native classes are new in 
this release.
   
   ### How was this patch tested?
   
   - New `crates/spark-connect/tests/classification_estimator_loads_golden.rs` 
replays the golden of official PySpark 4.3.0 for the NaiveBayes estimators of 
all four model types, MultilayerPerceptronClassifier and FMClassifier. Each 
load sends the golden's ML Read, and gets the read uid and the names of the 
read params. The save of the loaded estimator sends the golden's commands, 
which also compares the values of the params as PySpark re-sends them.
   - A mutation that changes FMClassifier's `maxIter` after the load fails the 
test.
   - The crate's offline tests pass.
   - `cargo fmt --check`, `cargo +1.100.0 clippy --workspace --all-targets -- 
-D warnings` and `scripts/audit_no_stubs.sh` are clean.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


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