Skip to content

Commit a08262d

Browse files
baishuorxin
authored andcommitted
Update LBFGSSuite.scala
the same reason as apache#588 Author: baishuo(白硕) <[email protected]> Closes apache#815 from baishuo/master and squashes the following commits: 6876c1e [baishuo(白硕)] Update LBFGSSuite.scala
1 parent b2bdd0e commit a08262d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class LBFGSSuite extends FunSuite with LocalSparkContext with ShouldMatchers {
4343
// Add an extra variable consisting of all 1.0's for the intercept.
4444
val testData = GradientDescentSuite.generateGDInput(A, B, nPoints, 42)
4545
val data = testData.map { case LabeledPoint(label, features) =>
46-
label -> Vectors.dense(1.0, features.toArray: _*)
46+
label -> Vectors.dense(1.0 +: features.toArray)
4747
}
4848

4949
lazy val dataRDD = sc.parallelize(data, 2).cache()
@@ -55,7 +55,7 @@ class LBFGSSuite extends FunSuite with LocalSparkContext with ShouldMatchers {
5555
test("LBFGS loss should be decreasing and match the result of Gradient Descent.") {
5656
val regParam = 0
5757

58-
val initialWeightsWithIntercept = Vectors.dense(1.0, initialWeights: _*)
58+
val initialWeightsWithIntercept = Vectors.dense(1.0 +: initialWeights.toArray)
5959
val convergenceTol = 1e-12
6060
val maxNumIterations = 10
6161

0 commit comments

Comments
 (0)