HyukjinKwon opened a new pull request, #725:
URL: https://github.com/apache/spark-connect-rust/pull/725

   ### What changes were proposed in this pull request?
   
   This is a follow-up of #708 (SPARK-61730), found while reviewing the last 50 
commits.
   
   The recorded API cases of the native tree classifiers did not cover several 
behaviors, so a regression in them would have gone unnoticed. This PR adds live 
cases for them to `python/tests/_tree_api_cases.py`, recorded on official 
PySpark 4.3.0 in `tests/golden/tree_api_cases.json`:
   
   - **GBTClassifier early stop**: a fit with `validationIndicatorCol` and 
`validationTol` that stops at 5 of 20 trees. The cases are `getNumTrees`, 
`treeWeights`, `evaluateEachIteration` and the trees.
   - **DecisionTreeClassifier and RandomForestClassifier with `leafCol`**: the 
columns of the transform and the leaf values.
   - **`weightCol` fits** of all three: the predictions and probabilities, and 
RandomForest's training summary `weightCol` and accuracy.
   - **Model thresholds**: `setThresholds` on DecisionTree and RandomForest 
models. `predict` ignores the thresholds, as in PySpark, and `transform` 
applies them.
   - **Fit errors raised by the server**: `RandomForestClassifier(numTrees=0)`, 
`GBTClassifier(stepSize=0)`, an unknown `validationIndicatorCol`, and 
GBTClassifier on a 3-class label.
   
   ### Why are the changes needed?
   
   These behaviors matched official PySpark already, but nothing checked them.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, tests only.
   
   ### How was this patch tested?
   
   - The golden is captured twice on official pyspark-client 4.3.0, and the two 
captures are byte-identical. Against the old golden, the new one only adds 31 
keys and changes none.
   - `test_tree_api_offline.py` and `test_tree_api_e2e.py` pass on this client, 
live against a Spark 4.3.0 Connect server. `test_tree_api_e2e.py` passes on 
official PySpark too, as the reference.
   - The offline suites pass on this client.
   - `ruff check` and `ruff format --check` are clean.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   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]

Reply via email to