-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20768][PYSPARK][ML] Expose numPartitions (expert) param of PySpark FPGrowth. #18058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,32 @@ def getMinSupport(self): | |
| return self.getOrDefault(self.minSupport) | ||
|
|
||
|
|
||
| class HasNumPartitions(Params): | ||
| """ | ||
| Mixin for param support. | ||
| """ | ||
|
|
||
| numPartitions = Param( | ||
| Params._dummy(), | ||
| "numPartitions", | ||
| """Number of partitions (at least 1) used by parallel FP-growth. | ||
|
||
| 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. | ||
|
||
| """ | ||
| return self.getOrDefault(self.numPartitions) | ||
|
|
||
|
|
||
| class HasConfidence(Params): | ||
| """ | ||
| Mixin for param confidence. | ||
|
|
@@ -126,7 +152,8 @@ def associationRules(self): | |
|
|
||
|
|
||
| class FPGrowth(JavaEstimator, HasItemsCol, HasPredictionCol, | ||
| HasSupport, HasConfidence, JavaMLWritable, JavaMLReadable): | ||
| HasSupport, HasNumPartitions, HasConfidence, | ||
| JavaMLWritable, JavaMLReadable): | ||
| """ | ||
| .. note:: Experimental | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified.