Skip to content
Snippets Groups Projects
Commit 82c1c577 authored by Xiangrui Meng's avatar Xiangrui Meng
Browse files

[MINOR][ML] fix compile warns

This fixes some compile time warnings.

Author: Xiangrui Meng <meng@databricks.com>

Closes #9319 from mengxr/mllib-compile-warn-20151027.
parent 826e1e30
No related branches found
No related tags found
No related merge requests found
...@@ -145,7 +145,7 @@ class LinearRegression(override val uid: String) ...@@ -145,7 +145,7 @@ class LinearRegression(override val uid: String)
// Extract the number of features before deciding optimization solver. // Extract the number of features before deciding optimization solver.
val numFeatures = dataset.select(col($(featuresCol))).limit(1).map { val numFeatures = dataset.select(col($(featuresCol))).limit(1).map {
case Row(features: Vector) => features.size case Row(features: Vector) => features.size
}.toArray()(0) }.first()
val w = if ($(weightCol).isEmpty) lit(1.0) else col($(weightCol)) val w = if ($(weightCol).isEmpty) lit(1.0) else col($(weightCol))
if (($(solver) == "auto" && $(elasticNetParam) == 0.0 && numFeatures <= 4096) || if (($(solver) == "auto" && $(elasticNetParam) == 0.0 && numFeatures <= 4096) ||
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.apache.spark.ml.classification package org.apache.spark.ml.classification
import scala.language.existentials
import scala.util.Random import scala.util.Random
import org.apache.spark.SparkFunSuite import org.apache.spark.SparkFunSuite
...@@ -24,7 +25,7 @@ import org.apache.spark.ml.feature.Instance ...@@ -24,7 +25,7 @@ import org.apache.spark.ml.feature.Instance
import org.apache.spark.ml.param.ParamsSuite import org.apache.spark.ml.param.ParamsSuite
import org.apache.spark.ml.util.MLTestingUtils import org.apache.spark.ml.util.MLTestingUtils
import org.apache.spark.mllib.classification.LogisticRegressionSuite._ 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.regression.LabeledPoint
import org.apache.spark.mllib.util.MLlibTestSparkContext import org.apache.spark.mllib.util.MLlibTestSparkContext
import org.apache.spark.mllib.util.TestingUtils._ import org.apache.spark.mllib.util.TestingUtils._
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment