Repository: spark
Updated Branches:
  refs/heads/master 69c773052 -> e5fbb182c


[MINOR] Remove unused arg in als.py

## What changes were proposed in this pull request?
The second arg in method `update()` is never used. So I delete it.

## How was this patch tested?
local run with `./bin/spark-submit examples/src/main/python/als.py`

Author: Zheng RuiFeng <ruife...@foxmail.com>

Closes #14247 from zhengruifeng/als_refine.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e5fbb182
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e5fbb182
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e5fbb182

Branch: refs/heads/master
Commit: e5fbb182c04be8524045fc90541497f506b42f4a
Parents: 69c7730
Author: Zheng RuiFeng <ruife...@foxmail.com>
Authored: Mon Jul 18 22:57:13 2016 -0700
Committer: Reynold Xin <r...@databricks.com>
Committed: Mon Jul 18 22:57:13 2016 -0700

----------------------------------------------------------------------
 examples/src/main/python/als.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e5fbb182/examples/src/main/python/als.py
----------------------------------------------------------------------
diff --git a/examples/src/main/python/als.py b/examples/src/main/python/als.py
index 80290e7..6d32418 100755
--- a/examples/src/main/python/als.py
+++ b/examples/src/main/python/als.py
@@ -39,7 +39,7 @@ def rmse(R, ms, us):
     return np.sqrt(np.sum(np.power(diff, 2)) / (M * U))
 
 
-def update(i, vec, mat, ratings):
+def update(i, mat, ratings):
     uu = mat.shape[0]
     ff = mat.shape[1]
 
@@ -88,7 +88,7 @@ if __name__ == "__main__":
 
     for i in range(ITERATIONS):
         ms = sc.parallelize(range(M), partitions) \
-               .map(lambda x: update(x, msb.value[x, :], usb.value, Rb.value)) 
\
+               .map(lambda x: update(x, usb.value, Rb.value)) \
                .collect()
         # collect() returns a list, so array ends up being
         # a 3-d array, we take the first 2 dims for the matrix
@@ -96,7 +96,7 @@ if __name__ == "__main__":
         msb = sc.broadcast(ms)
 
         us = sc.parallelize(range(U), partitions) \
-               .map(lambda x: update(x, usb.value[x, :], msb.value, 
Rb.value.T)) \
+               .map(lambda x: update(x, msb.value, Rb.value.T)) \
                .collect()
         us = matrix(np.array(us)[:, :, 0])
         usb = sc.broadcast(us)


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

Reply via email to