Repository navigation
[SPARK-62493][CONNECT][PYTHON] Delegate standard BisectingKMeans operations to Rust - #1001
Closed
zhengruifeng wants to merge 1 commit into
Closed
zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
…ations to Rust Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Delegate
pyspark.ml.clustering.BisectingKMeansfit, transform, prediction, cost, training summaries and persistence to the existing Rust implementation. Python keeps its setters, parameter maps, copying and subclass hooks. Changes to estimator and model parameters reach Rust as soon as the setter returns.The standard and compatibility imports share the estimator, model and summary classes. The native
computeCostmethod uses the original PySpark warning location so filters forpyspark.ml.clusteringand the warn-once behavior still work.Why are the changes needed?
The standard Python estimator previously built its own ML requests. This lets Spark’s existing BisectingKMeans tests exercise the same implementation as Rust callers and continues the clustering migration started with KMeans. SPARK-62493 · KMeans PR #1000
Does this PR introduce any user-facing change?
The three compatibility classes now report
pyspark.ml.clusteringas their public module. The standard signatures and persistence format match PySpark 4.3.0.How was this patch tested?
[2, 2, 0, 0], weighted training cost of15.0andcomputeCostof12.5. It also exercises prediction, save/load and a lazy transform after releasing the loaded model.wasm-udf, Clippy, rustfmt, Ruff, and the vendoring, generated stub and binary license 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.