Repository navigation
[SPARK-62486][CONNECT][PYTHON] Delegate standard OneVsRest operations to Rust - #999
Closed
zhengruifeng wants to merge 1 commit into
Closed
zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
… 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?
Publish
OneVsRestandOneVsRestModelthroughpyspark.ml.classificationand re-export the same classes from the compatibility module. Python parameter mutations update their native state immediately.A fit with a built-in binary classifier uses the Rust implementation to fit one model per class. A Python subclass, a custom classifier, or a classifier with an instance-level fit override uses PySpark's fit loop so its hook sees each binary dataset. The public model composes the transforms of its current
modelslist. Replacing or reordering those models changes its predictions.Why are the changes needed?
After #998, OneVsRest was the remaining classifier whose standard and compatibility imports selected different implementations. The standard path can share native class fits and persistence while continuing to support Python-defined classifiers.
Does this PR introduce any user-facing change?
The import paths now resolve to the same estimator and model. The original public signatures are preserved. On the model,
modelsremains a mutable instance attribute and is also visible as a descriptor when inspecting the class.The native fit respects default-only classifier and column parameters and carries the base classifier's defaults into the binary submodels. The estimator and model readers restore saved defaults using the standard PySpark metadata rules.
How was this patch tested?
wasm-udf. Rust formatting, workspace Clippy and the binary license check passed.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.