spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mengxr <>
Subject [GitHub] spark pull request: [SPARK-10084] [MLlib] [Doc] Add Python example...
Date Wed, 19 Aug 2015 15:25:52 GMT
Github user mengxr commented on a diff in the pull request:
    --- Diff: docs/ ---
    @@ -133,6 +134,36 @@ for (AssociationRules.Rule<String> rule
     {% endhighlight %}
    +<div data-lang="python" markdown="1">
    +[`FPGrowth`](api/python/pyspark.mllib.html#pyspark.mllib.fpm.FPGrowth) implements the
    +FP-growth algorithm.
    +It take an `RDD` of transactions, where each transaction is an `List` of items of a generic
    +Calling `FPGrowth.train` with transactions returns an
    +that stores the frequent itemsets with their frequencies. The following
    +example illustrates how to mine frequent itemsets and association rules
    +(see [Association
    +Rules](mllib-frequent-pattern-mining.html#association-rules) for
    +details) from `transactions`.
    +{% highlight python %}
    +from pyspark.mllib.fpm import FPGrowth
    +data = sc.textFile("data/mllib/sample_fpgrowth.txt")
    +transactions = line: line.strip().split(' '))
    +model = FPGrowth.train(transactions, 0.2, 10)
    --- End diff --
    Use named arguments.

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message