Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/460#discussion_r11985631
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/recommendation/ALSSuite.scala ---
@@ -140,16 +169,21 @@ class ALSSuite extends FunSuite with
LocalSparkContext {
* @param implicitPrefs flag to test implicit feedback
* @param bulkPredict flag to test bulk prediciton
* @param negativeWeights whether the generated data can contain
negative values
+ * @param numBlocks number of blocks to partition users and
products into
+ * @param negativeFactors whether the generated user/product factors can
have negative entries
*/
def testALS(users: Int, products: Int, features: Int, iterations: Int,
samplingRate: Double, matchThreshold: Double, implicitPrefs: Boolean =
false,
- bulkPredict: Boolean = false, negativeWeights: Boolean = false)
+ bulkPredict: Boolean = false, negativeWeights: Boolean = false,
numBlocks: Int = -1,
+ negativeFactors: Boolean = true)
{
val (sampledRatings, trueRatings, truePrefs) =
ALSSuite.generateRatings(users, products,
- features, samplingRate, implicitPrefs, negativeWeights)
+ features, samplingRate, implicitPrefs, negativeWeights,
negativeFactors)
val model = implicitPrefs match {
- case false => ALS.train(sc.parallelize(sampledRatings), features,
iterations)
- case true => ALS.trainImplicit(sc.parallelize(sampledRatings),
features, iterations)
+ case false => ALS.train(sc.parallelize(sampledRatings), features,
iterations, 0.01,
+ numBlocks, 0L, !negativeFactors)
--- End diff --
Does the following fit?
~~~
case false =>
ALS.train(sc.parallelize(sampledRatings), features, iterations, 0.01,
numBlocks, 0L, !negativeFactors)
~~~
---
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.
---