spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkbradley <...@git.apache.org>
Subject [GitHub] spark pull request #17218: [SPARK-19281][PYTHON][ML] spark.ml Python API for...
Date Thu, 23 Mar 2017 19:22:18 GMT
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17218#discussion_r107757886
  
    --- Diff: python/pyspark/ml/fpm.py ---
    @@ -0,0 +1,211 @@
    +#
    +# 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
    +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:
    +            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]",
    +        typeConverter=TypeConverters.toFloat)
    +
    +    def setMinConfidence(self, value):
    +        """
    +        Sets the value of :py:attr:`minConfidence`.
    +        """
    +        if not 0 <= value <= 1:
    +            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)
    --- End diff --
    
    remove period "." from end of doc string here


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message