Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-7663

[MLLIB] feature.Word2Vec throws empty iterator error when the vocabulary size is zero

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.0
    • 1.5.0
    • ML, MLlib
    • None

    Description

      mllib.feature.Word2Vec at line 442: https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala#L442 uses `.head` to get the vector size. But it would throw an empty iterator error if the `minCount` is large enough to remove all words in the dataset.

      But due to this is not a common scenario, so maybe we can ignore it. If so, we can close the issue directly. If not, I can add some code to print more elegant error hits.

      Attachments

        Issue Links

          Activity

            People

              yinxusen Xusen Yin
              yinxusen Xusen Yin
              Xiangrui Meng Xiangrui Meng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: