Skip to content

[SPARK-62496][CONNECT][PYTHON] Delegate standard GaussianMixture operations to Rust - #1002

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:feature/standard-gaussian-mixture-rust
Closed

zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:feature/standard-gaussian-mixture-rust

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Route pyspark.ml.clustering.GaussianMixture fit, transform, prediction, component and training summary access, and persistence through the existing Rust implementation. Python setters update the native estimator and model parameters immediately. The standard and compatibility imports share GaussianMixture, GaussianMixtureModel, and GaussianMixtureSummary.

Why are the changes needed?

The standard estimator previously built ML requests in Python. Delegating these operations lets Spark’s existing PySpark GaussianMixture tests exercise the implementation Rust callers use, following KMeans and BisectingKMeans. SPARK-62496

Does this PR introduce any user-facing change?

The compatibility classes now report pyspark.ml.clustering as their public module. Standard method signatures, probability vectors, Gaussian component types and persistence formats match PySpark 4.3.0.

How was this patch tested?

  • Ran Spark 4.3.0’s official clustering, cache, pipeline and tuning tests against a live Spark Connect server and the built drop-in package. All eight clustering tests passed. Across the four suites, 25 tests passed and four pipeline tests were skipped upstream.
  • Added a weighted two-component fit with the Python ML request builders disabled. It checks the fitted mixture weights, means and covariances, point and DataFrame probability predictions, training log likelihood, and a lazy transform collected after the loaded model is released.
  • Verified that official PySpark and the Rust-backed client can read one another’s saved estimator and model, with optional Python transport and ML dependencies blocked in the Rust-backed process. Compared all public member kinds and signatures of the estimator, model and summary against official PySpark.
  • Ran the standard ML and native binding offline tests, mypy and Pyright stub tests, Rust library and live GaussianMixture tests, release integration-test compilation with and without wasm-udf, Clippy, rustfmt, Ruff and the generated-file checks.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: OpenAI Codex (GPT-6)

This pull request and its description were written by Isaac.

…ations to Rust

Co-authored-by: Isaac <no-reply@databricks.com>
@zhengruifeng
zhengruifeng deleted the feature/standard-gaussian-mixture-rust branch December 1, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant