hhbyyh commented on a change in pull request #17654: [SPARK-20351] [ML] Add
trait hasTrainingSummary to replace the duplicate code
URL: https://github.com/apache/spark/pull/17654#discussion_r241670451
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
##########
@@ -444,31 +444,21 @@ class LinearRegressionModel private[ml] (
@Since("1.4.0") override val uid: String,
@Since("2.0.0") val coefficients: Vector,
@Since("1.3.0") val intercept: Double)
- extends RegressionModel[Vector, LinearRegressionModel]
- with LinearRegressionParams with MLWritable {
-
- private var trainingSummary: Option[LinearRegressionTrainingSummary] = None
+ extends RegressionModel[Vector, LinearRegressionModel] with MLWritable
+ with LinearRegressionParams with
HasTrainingSummary[LinearRegressionTrainingSummary] {
override val numFeatures: Int = coefficients.size
+ private[ml]
+ override def setSummary(summary: Option[LinearRegressionTrainingSummary]):
this.type =
Review comment:
removed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]