srowen commented on a change in pull request #24814: set Int MaxValue
URL: https://github.com/apache/spark/pull/24814#discussion_r291577244
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala
 ##########
 @@ -233,7 +233,7 @@ class Word2Vec extends Serializable with Logging {
       a += 1
     }
     while (a < 2 * vocabSize) {
-      count(a) = 1e9.toInt
+      count(a) = Int.MaxValue
 
 Review comment:
   I think it can't be Long.MaxValue as later it sums counts which, I guess, 
could overflow. This is just supposed to be "a very big value" and I think it's 
safe to assume none are over Int.MaxValue. I suppose we could cap the values in 
the vocab array to this value to be safe. So, I think the change is OK.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to