Skip to content

predict_param

predict_param

Classes

PredictParam (BaseParam)

Define the predict method of HomoLR, HeteroLR, SecureBoosting

Parameters:

Name Type Description Default
threshold float or int

The threshold use to separate positive and negative class. Normally, it should be (0,1)

0.5
Source code in federatedml/param/predict_param.py
class PredictParam(BaseParam):
    """
    Define the predict method of HomoLR, HeteroLR, SecureBoosting

    Parameters
    ----------

    threshold: float or int
        The threshold use to separate positive and negative class. Normally, it should be (0,1)
    """

    def __init__(self, threshold=0.5):
        self.threshold = threshold

    def check(self):

        if type(self.threshold).__name__ not in ["float", "int"]:
            raise ValueError("predict param's predict_param {} not supported, should be float or int".format(
                self.threshold))

        LOGGER.debug("Finish predict parameter check!")
        return True
__init__(self, threshold=0.5) special
Source code in federatedml/param/predict_param.py
def __init__(self, threshold=0.5):
    self.threshold = threshold
check(self)
Source code in federatedml/param/predict_param.py
def check(self):

    if type(self.threshold).__name__ not in ["float", "int"]:
        raise ValueError("predict param's predict_param {} not supported, should be float or int".format(
            self.threshold))

    LOGGER.debug("Finish predict parameter check!")
    return True

Last update: 2021-12-03
Back to top