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

   ### What changes were proposed in this pull request?
   
   This adds the goldens of the regression and clustering models of official 
PySpark 4.3.0, captured with the shared helper of #668 
(`scripts/ml_golden_common.py`). The native ML parity work compares the typed 
models of the native classes against them.
   
   - `scripts/capture_regression_models_golden.py` captures 15 fits of the 8 
regression estimators. For each, it records its fitted model, the first tree of 
each ensemble, the training and evaluation summaries, and save and load of the 
estimator and the model. It writes 
`tests/golden/regression_{models,summaries,persistence}.json`.
   - `scripts/capture_clustering_models_golden.py` does the same for 10 fits of 
KMeans, BisectingKMeans, GaussianMixture and LDA. For LDA it covers both 
optimizers, so both `LocalLDAModel` and `DistributedLDAModel` with its 
`toLocal()`, plus the persistence of PowerIterationClustering. It writes 
`tests/golden/clustering_{models,summaries,persistence}.json`.
   
   Every public member of each model and summary class is recorded, except the 
Params API and persistence, which have their own goldens. The helper's 
completeness check fails on a member that is neither covered nor skipped. An 
entry has the ML commands that the member sends, the server's results and the 
member's value. The server errors are recorded as entries too, for example:
   - `coefficientStandardErrors`, `tValues` and `pValues` of a linear 
regression summary other than the normal solver's training summary;
   - the AIC of the tweedie family;
   - the `toString` of a generalized linear regression model whose `link` is 
not set.
   
   ### Why are the changes needed?
   
   They are the reference values and wire messages that the typed regression 
and clustering models of the native classes are compared to, as for the 
classification models.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test fixtures only.
   
   ### How was this patch tested?
   
   - Captured with the official `pyspark-client` 4.3.0 against a Spark 4.3.0 
Connect server, twice.
   - The regression files are byte-identical between the runs. So are the 
clustering files, except that the floats of the distributed (em) LDA model may 
vary in their last digit, from the server's order of reduction.
   - `ruff check` and `ruff format --check` 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