Github user MLnick commented on the pull request:
https://github.com/apache/spark/pull/11812#issuecomment-199698551
Here is my test case - I can replicate the `Infinity` similarities on a
small test dataset. It only occurs when the num partitions and the num
iterations is very high. It uses the [Lee corpus from
Gensim](https://github.com/piskvorky/gensim/blob/develop/gensim/test/test_data/lee_background.cor).
```scala
test("test Infinity similarity with many iterations") {
val doc = sc.textFile("/tmp/lee/lee.txt").map(line => line.split("
").toSeq)
val model = new Word2Vec()
.setNumPartitions(40)
.setNumIterations(20)
.setSeed(42L)
.fit(doc)
val syms = model.findSynonyms("war", 5)
syms.foreach { sym =>
assert(!(sym._2.isInfinite || sym._2.isNaN))
}
}
```
---
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]