Github user hhbyyh commented on a diff in the pull request:
https://github.com/apache/spark/pull/17586#discussion_r111312845
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala ---
@@ -287,6 +290,27 @@ class LinearSVCModel private[classification] (
@Since("2.2.0")
def setWeightCol(value: Double): this.type = set(threshold, value)
+ private var trainingSummary: Option[LinearSVCTrainingSummary] = None
+
+ private[classification]
+ def setSummary(summary: Option[LinearSVCTrainingSummary]): this.type = {
+ this.trainingSummary = summary
+ this
+ }
+
+ /**
+ * Gets summary of model on training set. An exception is
+ * thrown if `trainingSummary == None`.
+ */
+ @Since("2.2.0")
+ def summary: LinearSVCTrainingSummary = trainingSummary.getOrElse(
+ throw new SparkException("No training summary available for this
LinearSVCModel")
--- End diff --
I know other places has the same code here. But I don't think throwing an
exception here is proper. If summary is not defined, we should simply return
none, or keep this field as Option[LinearSVCTrainingSummary] to make that
expected by the users. Need to confirm with committers.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]