Github user yu-iskw commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6791#discussion_r33102462
  
    --- Diff: python/pyspark/mllib/clustering.py ---
    @@ -274,5 +276,63 @@ def _test():
             exit(-1)
     
     
    +class LDAModel(JavaModelWrapper):
    +
    +    """ A clustering model derived from the LDA method.
    +
    +    Latent Dirichlet Allocation (LDA), a topic model designed for text 
documents.
    +    Terminologyu
    +    - "word" = "term": an element of the vocabulary
    +    - "token": instance of a term appearing in a document
    +    - "topic": multinomial distribution over words representing some 
concept
    +    References:
    +    - Original LDA paper (journal version):
    +    Blei, Ng, and Jordan.  "Latent Dirichlet Allocation."  JMLR, 2003.
    +
    +    >>> from pyspark.mllib.linalg import Vectors
    +    >>> from collections import namedtuple
    +    >>> from numpy.testing import assert_almost_equal
    +    >>> data = [
    +    ...     [1, Vectors.dense([0.0, 1.0])],
    +    ...     [2, SparseVector(2, {0: 1.0})],
    +    ... ]
    +    >>> rdd =  sc.parallelize(data)
    +    >>> model = LDA.train(rdd, k=2)
    +    >>> model.vocabSize()
    +    2
    +    >>> topics = model.topicsMatrix()
    +    >>> topics_expect = array([[0.5,  0.5], [0.5, 0.5]])
    --- End diff --
    
    Can we use `...` to compare an array or a list?


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