zhengruifeng commented on code in PR #50199:
URL: https://github.com/apache/spark/pull/50199#discussion_r1992347220


##########
python/pyspark/ml/classification.py:
##########
@@ -909,7 +912,10 @@ def evaluate(self, dataset: DataFrame) -> 
"LinearSVCSummary":
         if not isinstance(dataset, DataFrame):
             raise TypeError("dataset must be a DataFrame but got %s." % 
type(dataset))
         java_lsvc_summary = self._call_java("evaluate", dataset)
-        return LinearSVCSummary(java_lsvc_summary)
+        s = LinearSVCSummary(java_lsvc_summary)
+        if is_remote():
+            s.__source_transformer__ = self  # type: ignore[attr-defined]

Review Comment:
   the testing summary `model.evaluate(df)` hold a reference to the model



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to