Skip to content

Commit

Permalink
fix mllib python doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed May 17, 2015
1 parent 2ca60ac commit 2b4371e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions python/pyspark/mllib/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,10 @@ def ndcgAt(self, k):
"""
Compute the average NDCG value of all the queries, truncated at ranking position k.
The discounted cumulative gain at position k is computed as:
sum,,i=1,,^k^ (2^{relevance of ''i''th item}^ - 1) / log(i + 1),
sum,,i=1,,^k^ (2^{relevance of ''i''th item}^ - 1) / log(i + 1),
and the NDCG is obtained by dividing the DCG value on the ground truth set.
In the current implementation, the relevance value is binary.
If a query has an empty ground truth set, zero will be used as ndcg together with
If a query has an empty ground truth set, zero will be used as NDCG together with
a log warning.
"""
return self.call("ndcgAt", int(k))
Expand Down
12 changes: 6 additions & 6 deletions python/pyspark/mllib/fpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class FPGrowth(object):
def train(cls, data, minSupport=0.3, numPartitions=-1):
"""
Computes an FP-Growth model that contains frequent itemsets.
:param data: The input data set, each element
contains a transaction.
:param minSupport: The minimal support level
(default: `0.3`).
:param numPartitions: The number of partitions used by parallel
FP-growth (default: same as input data).
:param data: The input data set, each element contains a
transaction.
:param minSupport: The minimal support level (default: `0.3`).
:param numPartitions: The number of partitions used by
parallel FP-growth (default: same as input data).
"""
model = callMLlibFunc("trainFPGrowthModel", data, float(minSupport), int(numPartitions))
return FPGrowthModel(model)
Expand Down

0 comments on commit 2b4371e

Please sign in to comment.