You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by me...@apache.org on 2015/10/28 07:41:47 UTC

spark git commit: [MINOR][ML] fix compile warns

Repository: spark
Updated Branches:
  refs/heads/master 826e1e304 -> 82c1c5772


[MINOR][ML] fix compile warns

This fixes some compile time warnings.

Author: Xiangrui Meng <me...@databricks.com>

Closes #9319 from mengxr/mllib-compile-warn-20151027.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/82c1c577
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/82c1c577
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/82c1c577

Branch: refs/heads/master
Commit: 82c1c5772817785709b0289f7d836beba812c791
Parents: 826e1e3
Author: Xiangrui Meng <me...@databricks.com>
Authored: Tue Oct 27 23:41:42 2015 -0700
Committer: Xiangrui Meng <me...@databricks.com>
Committed: Tue Oct 27 23:41:42 2015 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/regression/LinearRegression.scala   | 2 +-
 .../apache/spark/ml/classification/LogisticRegressionSuite.scala  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/82c1c577/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
index 573a61a..c3ee8b3 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
@@ -145,7 +145,7 @@ class LinearRegression(override val uid: String)
     // Extract the number of features before deciding optimization solver.
     val numFeatures = dataset.select(col($(featuresCol))).limit(1).map {
       case Row(features: Vector) => features.size
-    }.toArray()(0)
+    }.first()
     val w = if ($(weightCol).isEmpty) lit(1.0) else col($(weightCol))
 
     if (($(solver) == "auto" && $(elasticNetParam) == 0.0 && numFeatures <= 4096) ||

http://git-wip-us.apache.org/repos/asf/spark/blob/82c1c577/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
----------------------------------------------------------------------
diff --git a/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
index 5186c4e..e0a795e 100644
--- a/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
@@ -17,6 +17,7 @@
 
 package org.apache.spark.ml.classification
 
+import scala.language.existentials
 import scala.util.Random
 
 import org.apache.spark.SparkFunSuite
@@ -24,7 +25,7 @@ import org.apache.spark.ml.feature.Instance
 import org.apache.spark.ml.param.ParamsSuite
 import org.apache.spark.ml.util.MLTestingUtils
 import org.apache.spark.mllib.classification.LogisticRegressionSuite._
-import org.apache.spark.mllib.linalg.{Vectors, Vector}
+import org.apache.spark.mllib.linalg.{Vector, Vectors}
 import org.apache.spark.mllib.regression.LabeledPoint
 import org.apache.spark.mllib.util.MLlibTestSparkContext
 import org.apache.spark.mllib.util.TestingUtils._


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org