Repository navigation
[SPARK-62504][CONNECT][PYTHON] Delegate standard ML evaluator operations to Rust - #1008
Closed
zhengruifeng wants to merge 1 commit into
Closed
zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
…ons 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?
Route all six concrete classes in
pyspark.ml.evaluationthrough the existing Rust evaluators for evaluation and persistence. This coversBinaryClassificationEvaluator,MulticlassClassificationEvaluator,MultilabelClassificationEvaluator,RegressionEvaluator,ClusteringEvaluatorandRankingEvaluator.Python setters update native parameters immediately. The public
Evaluator.evaluate(dataset, params)still applies a nonempty parameter map to a copy and calls its_evaluatemethod. Python subclasses can override that method or select a different JVM evaluator. Both evaluation and saving use the selected JVM class.The standard module loads the original PySpark 4.3.0 definitions from
_upstream/evaluation.py. The existing compatibility imports refer to the same classes.Why are the changes needed?
Standard PySpark callers previously built evaluation requests in Python. The standard Python and Rust APIs can now share the same request implementation, and the upstream Python evaluator tests exercise the Rust implementation. SPARK-62504
Does this PR introduce any user-facing change?
No. The public Python signatures, metric direction, saved-evaluator format and dependencies are preserved.
How was this patch tested?
wasm-udf. Checked formatting, Clippy, Ruff, generated stubs, type annotations and vendored source.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.