zhengruifeng opened a new pull request, #605: URL: https://github.com/apache/spark-connect-rust/pull/605
### What changes were proposed in this pull request? Add the three remaining native classification estimators in Rust and `pyspark.ml.connect.classification`: - `FMClassifier` fits Spark's JVM factorization machine classifier and returns a cached model. - `MultilayerPerceptronClassifier` fits Spark's JVM neural-network classifier, including integer layer arrays and dense/sparse initial-weight vectors. - `OneVsRest` performs multiclass reduction in Rust, fitting independent binary classifiers with bounded parallelism and combining their positive-class raw scores. It supports all eight native base classifiers, instance weights where supported, custom columns, temporary-cache cleanup and lazy model ownership. Score selection preserves PySpark's first-tie and NaN/null behavior. Expose all constructor parameters and named setters (17 for FM, 13 for the perceptron plus `setThresholds`, and 7 for OneVsRest), with typed Rust setters/getters. Add official parameter goldens, Rust/Python tests, CI coverage and compatibility documentation. ### Why are the changes needed? These are the remaining classifier estimator classes missing from the native ML APIs. They enable interaction-based binary classification, multilayer neural networks and multiclass reduction using existing native binary classifiers. ### Does this PR introduce _any_ user-facing change? Yes. Rust and native Python users can configure, fit and transform with these three classifiers. Python `fit` returns the shared native `MLModel`. OneVsRest accepts native base classifiers and observes their parameter changes made before fitting, while keeping independent snapshots for its binary fits. This adds estimator configuration, fitting and DataFrame predictions. Model inspection, training summaries, persistence and single-vector prediction remain separate API work. ### How was this patch tested? - 665 Rust unit tests and four live Rust classifier tests passed. The live tests cover numerical predictions, dense/sparse initial weights, parallel OneVsRest fits, model cloning/lifetime, session checks and the composite ML relation. - Seven parameter cases captured with official PySpark 4.3.0 match Rust encoding. Native Python constructor/setter requests also match the direct-classifier fixtures. - 36 behavior cases were verified with official PySpark and the native Python client, covering both FM solvers, both perceptron solvers, hidden layers, every OneVsRest base classifier, weights, independent/lazy models, ties/NaNs, empty-data behavior and invalid parameters. Two shared native model-lifetime/session tests also passed. - 2,099 Python offline tests passed (8 skips, 14 passing subtests), plus the final focused parameter checks. Constructor order/defaults and named setters match official PySpark. The SQL API introspection check found no missing public members beyond the documented transport-internal exclusions. - Official Spark 4.3.0 Connect suite through the Rust transport: 2,638 passed, 589 skipped across 87 files, with zero unexpected failures. The three artifact/local-cluster test files require a separate cluster environment and were excluded. - All integration tests compile with and without `wasm-udf`. Rust formatting, Ruff lint/format and whitespace checks passed. Clippy passed for the core and new test targets; workspace/Python Clippy still reports errors at code unchanged from the base commit. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-6) 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]
