Skip to content

Commit 45b95fb

Browse files
committed
Update GradientDescentSuite.scala
1 parent c03b61c commit 45b95fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mllib/src/test/scala/org/apache/spark/mllib/optimization/GradientDescentSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ class GradientDescentSuite extends FunSuite with LocalSparkContext with ShouldMa
8181
// Add a extra variable consisting of all 1.0's for the intercept.
8282
val testData = GradientDescentSuite.generateGDInput(A, B, nPoints, 42)
8383
val data = testData.map { case LabeledPoint(label, features) =>
84-
label -> Vectors.dense(1.0 +: features)
84+
label -> Vectors.dense(1.0 +: features.toArray)
8585
}
8686

8787
val dataRDD = sc.parallelize(data, 2).cache()
88-
val initialWeightsWithIntercept = Vectors.dense(1.0 +: initialWeights)
88+
val initialWeightsWithIntercept = Vectors.dense(1.0 +: initialWeights.toArray)
8989

9090
val (_, loss) = GradientDescent.runMiniBatchSGD(
9191
dataRDD,
@@ -111,7 +111,7 @@ class GradientDescentSuite extends FunSuite with LocalSparkContext with ShouldMa
111111
// Add a extra variable consisting of all 1.0's for the intercept.
112112
val testData = GradientDescentSuite.generateGDInput(2.0, -1.5, 10000, 42)
113113
val data = testData.map { case LabeledPoint(label, features) =>
114-
label -> Vectors.dense(1.0 +: features)
114+
label -> Vectors.dense(1.0 +: features.toArray)
115115
}
116116

117117
val dataRDD = sc.parallelize(data, 2).cache()

0 commit comments

Comments
 (0)