Skip to content

Commit ee1a85a

Browse files
committed
Cleaning up unit tests a bit and modifying a few cases
1 parent 3ee8711 commit ee1a85a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mllib/src/test/scala/org/apache/spark/mllib/linalg/VectorsSuite.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class VectorsSuite extends FunSuite {
9696
assert(max2 === 2)
9797

9898
// check for case that sparse vector is created with only negative values {0.0, 0.0,-1.0, -0.7, 0.0}
99-
val vec4 = Vectors.sparse(5,Array(0, 1, 2, 3),Array(0.0, 0.0, -1.0,-.7))
99+
val vec4 = Vectors.sparse(5,Array(2, 3),Array(-1.0,-.7))
100100
val max3 = vec4.argmax
101101
assert(max3 === 0)
102102

@@ -108,9 +108,7 @@ class VectorsSuite extends FunSuite {
108108
val max5 = vec6.argmax
109109
assert(max5 === 1)
110110

111-
// test that converting the sparse vector to another sparse vector then calling argmax still works right
112-
var vec8 = Vectors.sparse(5,Array(0, 1),Array(0.0, -1.0))
113-
vec8 = vec8.toSparse
111+
var vec8 = Vectors.sparse(5,Array(1, 2),Array(0.0, -1.0))
114112
val max7 = vec8.argmax
115113
assert(max7 === 0)
116114
}

0 commit comments

Comments
 (0)