diff options
author | MechCoder <manojkumarsivaraj334@gmail.com> | 2015-06-17 22:08:38 -0700 |
---|---|---|
committer | Davies Liu <davies@databricks.com> | 2015-06-17 22:08:38 -0700 |
commit | 22732e1eca730929345e440ba831386ee7446b74 (patch) | |
tree | bdd891792462222c50ebd324efb154980c320d5a /mllib | |
parent | 4817ccdf50ef6ee24192800f9924d9ef3bb74e12 (diff) | |
download | spark-22732e1eca730929345e440ba831386ee7446b74.tar.gz spark-22732e1eca730929345e440ba831386ee7446b74.tar.bz2 spark-22732e1eca730929345e440ba831386ee7446b74.zip |
[SPARK-7605] [MLLIB] [PYSPARK] Python API for ElementwiseProduct
Python API for org.apache.spark.mllib.feature.ElementwiseProduct
Author: MechCoder <manojkumarsivaraj334@gmail.com>
Closes #6346 from MechCoder/spark-7605 and squashes the following commits:
79d1ef5 [MechCoder] Consistent and support list / array types
5f81d81 [MechCoder] [SPARK-7605] [MLlib] Python API for ElementwiseProduct
Diffstat (limited to 'mllib')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala b/mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala index 8f66bc808a..1812b3ac7c 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala @@ -702,6 +702,14 @@ private[python] class PythonMLLibAPI extends Serializable { } } + def elementwiseProductVector(scalingVector: Vector, vector: Vector): Vector = { + new ElementwiseProduct(scalingVector).transform(vector) + } + + def elementwiseProductVector(scalingVector: Vector, vector: JavaRDD[Vector]): JavaRDD[Vector] = { + new ElementwiseProduct(scalingVector).transform(vector) + } + /** * Java stub for mllib Statistics.colStats(X: RDD[Vector]). * TODO figure out return type. |