@@ -49,6 +49,32 @@ def getMinSupport(self):
4949 return self .getOrDefault (self .minSupport )
5050
5151
52+ class HasNumPartitions (Params ):
53+ """
54+ Mixin for param support.
55+ """
56+
57+ numPartitions = Param (
58+ Params ._dummy (),
59+ "numPartitions" ,
60+ """Number of partitions (at least 1) used by parallel FP-growth.
61+ By default the param is not set,
62+ and partition number of the input dataset is used.""" ,
63+ typeConverter = TypeConverters .toInt )
64+
65+ def setNumPartitions (self , value ):
66+ """
67+ Sets the value of :py:attr:`numPartitions`.
68+ """
69+ return self ._set (numPartitions = value )
70+
71+ def getNumPartitions (self ):
72+ """
73+ Gets the value of numPartitions or its default value.
74+ """
75+ return self .getOrDefault (self .numPartitions )
76+
77+
5278class HasConfidence (Params ):
5379 """
5480 Mixin for param confidence.
@@ -126,7 +152,8 @@ def associationRules(self):
126152
127153
128154class FPGrowth (JavaEstimator , HasItemsCol , HasPredictionCol ,
129- HasSupport , HasConfidence , JavaMLWritable , JavaMLReadable ):
155+ HasSupport , HasNumPartitions , HasConfidence ,
156+ JavaMLWritable , JavaMLReadable ):
130157 """
131158 .. note:: Experimental
132159
0 commit comments