Skip to content
Snippets Groups Projects
Commit a08262d8 authored by baishuo(白硕)'s avatar baishuo(白硕) Committed by Reynold Xin
Browse files

Update LBFGSSuite.scala

the same reason as https://github.com/apache/spark/pull/588

Author: baishuo(白硕) <vc_java@hotmail.com>

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

6876c1e [baishuo(白硕)] Update LBFGSSuite.scala
parent b2bdd0e5
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......@@ -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
......
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