GitHub user mengxr reopened a pull request:
https://github.com/apache/spark/pull/165
[SPARK-1266] persist factors in implicit ALS
In implicit ALS computation, the user or product factor is used twice in
each iteration. Caching can certainly help accelerate the computation. I saw
the running time decreased by ~70% for implicit ALS on the movielens data.
I also made the following changes:
1. Change `YtYb` type from `Broadcast[Option[DoubleMatrix]]` to
`Option[Broadcast[DoubleMatrix]]`, so we don't need to broadcast None in
explicit computation.
2. Mark methods `computeYtY`, `unblockFactors`, `updateBlock`, and
`updateFeatures private`. Users do not need those methods.
3. Materialize the final matrix factors before returning the model. It
allows us to clean up other cached RDDs before returning the model. I do not
have a better solution here, so I use `RDD.count()`.
JIRA: https://spark-project.atlassian.net/browse/SPARK-1266
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mengxr/spark als
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/165.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 #165
----
commit 63862d63a8ae06e21a52918c0097a7f1c843ee5d
Author: Xiangrui Meng <[email protected]>
Date: 2014-03-17T23:20:24Z
persist factors in implicit ALS
commit d3a88aa026b6a3734e6fc515589e604df81913a6
Author: Xiangrui Meng <[email protected]>
Date: 2014-03-18T07:39:29Z
change implicitPrefs match to if ... else ...
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---