Skip to content

Commit

Permalink
Update LBFGSSuite.scala
Browse files Browse the repository at this point in the history
the same reason as #588

Author: baishuo(白硕) <[email protected]>

Closes #815 from baishuo/master and squashes the following commits:

6876c1e [baishuo(白硕)] Update LBFGSSuite.scala

(cherry picked from commit a08262d)
Signed-off-by: Reynold Xin <[email protected]>
  • Loading branch information
baishuo authored and rxin committed May 23, 2014
1 parent 6541ca2 commit 9be103a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LBFGSSuite extends FunSuite with LocalSparkContext with ShouldMatchers {
// Add an extra variable consisting of all 1.0's for the intercept.
val testData = GradientDescentSuite.generateGDInput(A, B, nPoints, 42)
val data = testData.map { case LabeledPoint(label, features) =>
label -> Vectors.dense(1.0, features.toArray: _*)
label -> Vectors.dense(1.0 +: features.toArray)
}

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

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

Expand Down

0 comments on commit 9be103a

Please sign in to comment.