aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main
diff options
context:
space:
mode:
authorZheng RuiFeng <ruifengz@foxmail.com>2016-07-18 22:57:13 -0700
committerReynold Xin <rxin@databricks.com>2016-07-18 22:57:13 -0700
commite5fbb182c04be8524045fc90541497f506b42f4a (patch)
treef86eea3795a3cc894e2cd6060b63b828bd463c57 /examples/src/main
parent69c773052acc627eb033614797de9b913dfa35c1 (diff)
downloadspark-e5fbb182c04be8524045fc90541497f506b42f4a.tar.gz
spark-e5fbb182c04be8524045fc90541497f506b42f4a.tar.bz2
spark-e5fbb182c04be8524045fc90541497f506b42f4a.zip
[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 <ruifengz@foxmail.com> Closes #14247 from zhengruifeng/als_refine.
Diffstat (limited to 'examples/src/main')
-rwxr-xr-xexamples/src/main/python/als.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/src/main/python/als.py b/examples/src/main/python/als.py
index 80290e7de9..6d3241876a 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)