Skip to content

Commit

Permalink
[SPARK-10274] [MLLIB] Add @SInCE annotation to pyspark.mllib.fpm
Browse files Browse the repository at this point in the history
Author: Yu ISHIKAWA <yuu.ishikawa@gmail.com>

Closes #8665 from yu-iskw/SPARK-10274.
  • Loading branch information
yu-iskw authored and mengxr committed Sep 17, 2015
1 parent 4a0b56e commit c74d38f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/pyspark/mllib/fpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from numpy import array
from collections import namedtuple

from pyspark import SparkContext
from pyspark import SparkContext, since
from pyspark.rdd import ignore_unicode_prefix
from pyspark.mllib.common import JavaModelWrapper, callMLlibFunc, inherit_doc

Expand All @@ -41,8 +41,11 @@ class FPGrowthModel(JavaModelWrapper):
>>> model = FPGrowth.train(rdd, 0.6, 2)
>>> sorted(model.freqItemsets().collect())
[FreqItemset(items=[u'a'], freq=4), FreqItemset(items=[u'c'], freq=3), ...
.. versionadded:: 1.4.0
"""

@since("1.4.0")
def freqItemsets(self):
"""
Returns the frequent itemsets of this model.
Expand All @@ -55,9 +58,12 @@ class FPGrowth(object):
.. note:: Experimental
A Parallel FP-growth algorithm to mine frequent itemsets.
.. versionadded:: 1.4.0
"""

@classmethod
@since("1.4.0")
def train(cls, data, minSupport=0.3, numPartitions=-1):
"""
Computes an FP-Growth model that contains frequent itemsets.
Expand All @@ -74,6 +80,8 @@ def train(cls, data, minSupport=0.3, numPartitions=-1):
class FreqItemset(namedtuple("FreqItemset", ["items", "freq"])):
"""
Represents an (items, freq) tuple.
.. versionadded:: 1.4.0
"""


Expand Down

0 comments on commit c74d38f

Please sign in to comment.