Skip to content

one_vs_rest_param

one_vs_rest_param

Classes

OneVsRestParam (BaseParam)

Define the one_vs_rest parameters.

Parameters:

Name Type Description Default
has_arbiter bool, default: true

For some algorithm, may not has arbiter, for instances, secureboost of FATE, for these algorithms, it should be set to false.

True
Source code in federatedml/param/one_vs_rest_param.py
class OneVsRestParam(BaseParam):
    """
    Define the one_vs_rest parameters.

    Parameters
    ----------
    has_arbiter: bool, default: true
        For some algorithm, may not has arbiter, for instances, secureboost of FATE,
        for these algorithms, it should be set to false.
    """

    def __init__(self, need_one_vs_rest=False, has_arbiter=True):
        super().__init__()
        self.need_one_vs_rest = need_one_vs_rest
        self.has_arbiter = has_arbiter

    def check(self):
        if type(self.has_arbiter).__name__ != "bool":
            raise ValueError(
                "one_vs_rest param's has_arbiter {} not supported, should be bool type".format(
                    self.has_arbiter))

        LOGGER.debug("Finish one_vs_rest parameter check!")
        return True
__init__(self, need_one_vs_rest=False, has_arbiter=True) special
Source code in federatedml/param/one_vs_rest_param.py
def __init__(self, need_one_vs_rest=False, has_arbiter=True):
    super().__init__()
    self.need_one_vs_rest = need_one_vs_rest
    self.has_arbiter = has_arbiter
check(self)
Source code in federatedml/param/one_vs_rest_param.py
def check(self):
    if type(self.has_arbiter).__name__ != "bool":
        raise ValueError(
            "one_vs_rest param's has_arbiter {} not supported, should be bool type".format(
                self.has_arbiter))

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

Last update: 2021-12-03
Back to top