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

    https://github.com/apache/spark/pull/9469#discussion_r43904647
  
    --- Diff: python/pyspark/mllib/fpm.py ---
    @@ -85,6 +85,72 @@ class FreqItemset(namedtuple("FreqItemset", ["items", 
"freq"])):
             """
     
     
    +@inherit_doc
    +@ignore_unicode_prefix
    +class PrefixSpanModel(JavaModelWrapper):
    +    """
    +    .. note:: Experimental
    +
    +    Model fitted by PrefixSpan
    +
    +    >>> data = [
    +    ...    [["a", "b"], ["c"]],
    +    ...    [["a"], ["c", "b"], ["a", "b"]],
    +    ...    [["a", "b"], ["e"]],
    +    ...    [["f"]]]
    +    >>> rdd = sc.parallelize(data, 2)
    +    >>> model = PrefixSpan.train(rdd)
    +    >>> sorted(model.freqSequences().collect())
    +    [FreqSequences(sequence=[[u'a']], freq=3), 
FreqSequences(sequence=[[u'a'], [u'a']], freq=1), ...
    +
    +    .. versionadded:: 1.6.0
    +    """
    +
    +    @since("1.6.0")
    +    def freqSequences(self):
    +        """Gets frequence sequences"""
    +        return self.call("getFreqSequences").map(lambda x: 
PrefixSpan.FreqSequences(x[0], x[1]))
    +
    +
    +class PrefixSpan(object):
    +    """
    +    .. note:: Experimental
    +
    +    A parallel PrefixSpan algorithm to mine frequent sequential patterns.
    +    The PrefixSpan algorithm is described in J. Pei, et al., PrefixSpan: 
Mining Sequential Patterns
    --- End diff --
    
    line too wide for docstring (72 chars in  PEP8)


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