Skip to content

Commit 913a6bf

Browse files
committed
[SPARK-19281][FOLLOWUP][ML] Minor fix for PySpark FPGrowth.
## What changes were proposed in this pull request? Follow-up for #17218, some minor fix for PySpark ```FPGrowth```. ## How was this patch tested? Existing UT. Author: Yanbo Liang <[email protected]> Closes #18089 from yanboliang/spark-19281.
1 parent 3f94e64 commit 913a6bf

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

python/pyspark/ml/fpm.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
__all__ = ["FPGrowth", "FPGrowthModel"]
2424

2525

26-
class HasSupport(Params):
26+
class HasMinSupport(Params):
2727
"""
28-
Mixin for param support.
28+
Mixin for param minSupport.
2929
"""
3030

3131
minSupport = Param(
3232
Params._dummy(),
3333
"minSupport",
34-
"""Minimal support level of the frequent pattern. [0.0, 1.0].
35-
Any pattern that appears more than (minSupport * size-of-the-dataset)
36-
times will be output""",
34+
"Minimal support level of the frequent pattern. [0.0, 1.0]. " +
35+
"Any pattern that appears more than (minSupport * size-of-the-dataset) " +
36+
"times will be output in the frequent itemsets.",
3737
typeConverter=TypeConverters.toFloat)
3838

3939
def setMinSupport(self, value):
@@ -49,16 +49,17 @@ def getMinSupport(self):
4949
return self.getOrDefault(self.minSupport)
5050

5151

52-
class HasConfidence(Params):
52+
class HasMinConfidence(Params):
5353
"""
54-
Mixin for param confidence.
54+
Mixin for param minConfidence.
5555
"""
5656

5757
minConfidence = Param(
5858
Params._dummy(),
5959
"minConfidence",
60-
"""Minimal confidence for generating Association Rule. [0.0, 1.0]
61-
Note that minConfidence has no effect during fitting.""",
60+
"Minimal confidence for generating Association Rule. [0.0, 1.0]. " +
61+
"minConfidence will not affect the mining for frequent itemsets, " +
62+
"but will affect the association rules generation.",
6263
typeConverter=TypeConverters.toFloat)
6364

6465
def setMinConfidence(self, value):
@@ -126,7 +127,7 @@ def associationRules(self):
126127

127128

128129
class FPGrowth(JavaEstimator, HasItemsCol, HasPredictionCol,
129-
HasSupport, HasConfidence, JavaMLWritable, JavaMLReadable):
130+
HasMinSupport, HasMinConfidence, JavaMLWritable, JavaMLReadable):
130131
"""
131132
.. note:: Experimental
132133

0 commit comments

Comments
 (0)