You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/12/16 14:33:19 UTC

[GitHub] [spark] WeichenXu123 opened a new pull request #26910: [SPARK-30154][ML] PySpark UDF to convert MLlib vectors to dense arrays

WeichenXu123 opened a new pull request #26910: [SPARK-30154][ML] PySpark UDF to convert MLlib vectors to dense arrays
URL: https://github.com/apache/spark/pull/26910
 
 
   ### What changes were proposed in this pull request?
   
   PySpark UDF to convert MLlib vectors to dense arrays.
   Example:
   ```
   from pyspark.ml.functions import vector_to_dense_array
   df.select(vector_to_dense_array(col("features"))
   ```
   
   ### Why are the changes needed?
   If a PySpark user wants to convert MLlib sparse/dense vectors in a DataFrame into dense arrays, an efficient approach is to do that in JVM. However, it requires PySpark user to write Scala code and register it as a UDF. Often this is infeasible for a pure python project.
   
   ### Does this PR introduce any user-facing change?
   No.
   
   ### How was this patch tested?
   UT.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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