Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17218#discussion_r108048659
  
    --- Diff: python/pyspark/ml/fpm.py ---
    @@ -0,0 +1,232 @@
    +#
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#    http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
    +
    +from pyspark import keyword_only, since
    +from pyspark.ml.util import *
    +from pyspark.ml.wrapper import JavaEstimator, JavaModel
    +from pyspark.ml.param.shared import *
    +
    +__all__ = ["FPGrowth", "FPGrowthModel"]
    +
    +
    +class HasSupport(Params):
    +    """
    +    Mixin for param support: [0.0, 1.0].
    +    """
    +
    +    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",
    +        typeConverter=TypeConverters.toFloat)
    +
    +    def setMinSupport(self, value):
    +        """
    +        Sets the value of :py:attr:`minSupport`.
    +        """
    +        if not (0 <= value <= 1):
    +            raise ValueError("Support must be in range [0, 1]")
    +        return self._set(minSupport=value)
    +
    +    def getMinSupport(self):
    +        """
    +        Gets the value of minSupport or its default value.
    +        """
    +        return self.getOrDefault(self.minSupport)
    +
    +
    +class HasConfidence(Params):
    +    """
    +    Mixin for param confidence: [0.0, 1.0].
    +    """
    +
    +    minConfidence = Param(
    +        Params._dummy(),
    +        "minConfidence",
    +        """"Minimal confidence for generating Association Rule. [0.0, 1.0]
    +        Note that minConfidence has no effect during fitting.""",
    +        typeConverter=TypeConverters.toFloat)
    +
    +    def setMinConfidence(self, value):
    +        """
    +        Sets the value of :py:attr:`minConfidence`.
    +        """
    +        if not (0 <= value <= 1):
    +            raise ValueError("Confidence must be in range [0, 1]")
    +        return self._set(minConfidence=value)
    +
    +    def getMinConfidence(self):
    +        """
    +        Gets the value of minConfidence or its default value.
    +        """
    +        return self.getOrDefault(self.minConfidence)
    +
    +
    +class HasItemsCol(Params):
    +    """
    +    Mixin for param itemsCol: items column name.
    +    """
    +
    +    itemsCol = Param(Params._dummy(), "itemsCol",
    +                     "items column name", 
typeConverter=TypeConverters.toString)
    +
    +    def setItemsCol(self, value):
    +        """
    +        Sets the value of :py:attr:`itemsCol`.
    +        """
    +        return self._set(itemsCol=value)
    +
    +    def getItemsCol(self):
    +        """
    +        Gets the value of itemsCol or its default value.
    +        """
    +        return self.getOrDefault(self.itemsCol)
    +
    +
    +class FPGrowthModel(JavaModel, JavaMLWritable, JavaMLReadable,
    +                    HasConfidence, HasItemsCol, HasPredictionCol):
    +    """Model fitted by FPGrowth.
    +
    +    .. note:: Experimental
    --- End diff --
    
    Put first in doc string  (See examples elsewhere)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to