srowen commented on a change in pull request #26826:
[SPARK-30195][SQL][CORE][ML] Change some function, import definitions to work
with stricter compiler in Scala 2.13
URL: https://github.com/apache/spark/pull/26826#discussion_r355826825
##########
File path:
mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixture.scala
##########
@@ -272,7 +272,10 @@ class GaussianMixture private (
private def initCovariance(x: IndexedSeq[BV[Double]]): BreezeMatrix[Double]
= {
val mu = vectorMean(x)
val ss = BDV.zeros[Double](x(0).length)
- x.foreach(xi => ss += (xi - mu) ^:^ 2.0)
+ x.foreach { xi =>
+ val d: BV[Double] = xi - mu
+ ss += d ^:^ 2.0
Review comment:
I still don't quite get why this didn't compile in 2.13, but making d's type
clear worked.
----------------------------------------------------------------
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.
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]