Skip to content
Snippets Groups Projects
Commit 913a6bfe authored by Yanbo Liang's avatar Yanbo Liang
Browse files

[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 <ybliang8@gmail.com>

Closes #18089 from yanboliang/spark-19281.
parent 3f94e64a
No related branches found
No related tags found
No related merge requests found
......@@ -23,17 +23,17 @@ from pyspark.ml.param.shared import *
__all__ = ["FPGrowth", "FPGrowthModel"]
class HasSupport(Params):
class HasMinSupport(Params):
"""
Mixin for param support.
Mixin for param minSupport.
"""
minSupport = Param(
Params._dummy(),
"minSupport",
"""Minimal support level of the frequent pattern. [0.0, 1.0].
Any pattern that appears more than (minSupport * size-of-the-dataset)
times will be output""",
"Minimal support level of the frequent pattern. [0.0, 1.0]. " +
"Any pattern that appears more than (minSupport * size-of-the-dataset) " +
"times will be output in the frequent itemsets.",
typeConverter=TypeConverters.toFloat)
def setMinSupport(self, value):
......@@ -49,16 +49,17 @@ class HasSupport(Params):
return self.getOrDefault(self.minSupport)
class HasConfidence(Params):
class HasMinConfidence(Params):
"""
Mixin for param confidence.
Mixin for param minConfidence.
"""
minConfidence = Param(
Params._dummy(),
"minConfidence",
"""Minimal confidence for generating Association Rule. [0.0, 1.0]
Note that minConfidence has no effect during fitting.""",
"Minimal confidence for generating Association Rule. [0.0, 1.0]. " +
"minConfidence will not affect the mining for frequent itemsets, " +
"but will affect the association rules generation.",
typeConverter=TypeConverters.toFloat)
def setMinConfidence(self, value):
......@@ -126,7 +127,7 @@ class FPGrowthModel(JavaModel, JavaMLWritable, JavaMLReadable):
class FPGrowth(JavaEstimator, HasItemsCol, HasPredictionCol,
HasSupport, HasConfidence, JavaMLWritable, JavaMLReadable):
HasMinSupport, HasMinConfidence, JavaMLWritable, JavaMLReadable):
"""
.. note:: Experimental
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment