[GitHub] spark pull request #20275: [SPARK-23085][ML] API parity for mllib.linalg.Vec...

2018-01-19 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/20275


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20275: [SPARK-23085][ML] API parity for mllib.linalg.Vec...

2018-01-18 Thread MLnick
Github user MLnick commented on a diff in the pull request:

https://github.com/apache/spark/pull/20275#discussion_r162292944
  
--- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/linalg/VectorsSuite.scala ---
@@ -113,6 +113,13 @@ class VectorsSuite extends SparkFunSuite with Logging {
 assert(vec.toArray === arr)
   }
 
+  test("zero-length sparse vector") {
--- End diff --

While we're doing this we may as well also add a test to `intercept` the 
exception for negative size (as per the other sparse vector construction 
tests), for both `ml` and `mllib`


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20275: [SPARK-23085][ML] API parity for mllib.linalg.Vec...

2018-01-18 Thread MLnick
Github user MLnick commented on a diff in the pull request:

https://github.com/apache/spark/pull/20275#discussion_r162292520
  
--- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/linalg/VectorsSuite.scala ---
@@ -113,6 +113,13 @@ class VectorsSuite extends SparkFunSuite with Logging {
 assert(vec.toArray === arr)
   }
 
+  test("zero-length sparse vector") {
--- End diff --

We may as well add the same test to `ml.linalg`


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20275: [SPARK-23085][ML] API parity for mllib.linalg.Vec...

2018-01-15 Thread zhengruifeng
GitHub user zhengruifeng opened a pull request:

https://github.com/apache/spark/pull/20275

[SPARK-23085][ML] API parity for mllib.linalg.Vectors.sparse 

## What changes were proposed in this pull request?
`ML.Vectors#sparse(size: Int, elements: Seq[(Int, Double)])` support 
zero-length

## How was this patch tested?
existing tests

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zhengruifeng/spark SparseVector_size

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/20275.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #20275


commit 8b2876e5c5059a1fb258bff53ae6667df80d3205
Author: Zheng RuiFeng 
Date:   2018-01-16T01:46:47Z

nit

commit 1a3cd3aab355a00a73993979896624a8684a9aad
Author: Zheng RuiFeng 
Date:   2018-01-16T05:49:40Z

update pr




---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org