Github user holdenk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12560#discussion_r60531928
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala 
---
    @@ -395,13 +395,21 @@ class ALS(@Since("1.4.0") override val uid: String) 
extends Estimator[ALSModel]
           .map { row =>
             Rating(row.getInt(0), row.getInt(1), row.getFloat(2))
           }
    +    val instr = Instrumentation.create(this, ratings)
    +    instr.logParams(rank, numUserBlocks, numItemBlocks, implicitPrefs, 
alpha,
    +                    userCol, itemCol, ratingCol, predictionCol, maxIter,
    +                    regParam, nonnegative, checkpointInterval, seed)
         val (userFactors, itemFactors) = ALS.train(ratings, rank = $(rank),
           numUserBlocks = $(numUserBlocks), numItemBlocks = $(numItemBlocks),
           maxIter = $(maxIter), regParam = $(regParam), implicitPrefs = 
$(implicitPrefs),
           alpha = $(alpha), nonnegative = $(nonnegative),
           checkpointInterval = $(checkpointInterval), seed = $(seed))
         val userDF = userFactors.toDF("id", "features")
         val itemDF = itemFactors.toDF("id", "features")
    +    val numUserFeatures = userDF.collect.size
    --- End diff --
    
    I don't think we need to collect the dataframes locally here to get the 
counts (maybe just use `count`) or maybe we could put this logging somewhere 
that already have the counts?


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to