Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion python/pyspark/ml/fpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@ def getMinSupport(self):
return self.getOrDefault(self.minSupport)


class HasNumPartitions(Params):
"""
Mixin for param support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixin for param numPartitions: Number of partitions (at least 1) used by parallel FP-growth.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified.

"""

numPartitions = Param(
Params._dummy(),
"numPartitions",
"""Number of partitions (at least 1) used by parallel FP-growth.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using """ to wrap doc here will get \n in generated Python API docs. You can update to use " referring to discussion at here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be scrubbed ? I think we have """ everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced.

By default the param is not set,
and partition number of the input dataset is used.""",
typeConverter=TypeConverters.toInt)

def setNumPartitions(self, value):
"""
Sets the value of :py:attr:`numPartitions`.
"""
return self._set(numPartitions=value)

def getNumPartitions(self):
"""
Gets the value of numPartitions or its default value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:py:attr:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

"""
return self.getOrDefault(self.numPartitions)


class HasConfidence(Params):
"""
Mixin for param confidence.
Expand Down Expand Up @@ -126,7 +152,8 @@ def associationRules(self):


class FPGrowth(JavaEstimator, HasItemsCol, HasPredictionCol,
HasSupport, HasConfidence, JavaMLWritable, JavaMLReadable):
HasSupport, HasNumPartitions, HasConfidence,
JavaMLWritable, JavaMLReadable):
"""
.. note:: Experimental

Expand Down