コード例 #1
0
 def __init__(self, base_algorithm, nchoices, c = None, pmin = 1e-5, njobs = -1):
     _check_constructor_input(base_algorithm, nchoices)
     self.base_algorithm = base_algorithm
     self.nchoices = nchoices
     self.tree = _BinTree(nchoices)
     if c is not None:
         assert isinstance(c, float)
     if pmin is not None:
         assert isinstance(pmin, float)
     self.c = c
     self.pmin = pmin
     self.njobs = _check_njobs(njobs)
コード例 #2
0
 def __init__(self, base_algorithm, nchoices, c = None, pmin = 1e-5, njobs = -1):
     try:
         from costsensitive import _BinTree
     except:
         raise ValueError("This functionality requires package 'costsensitive'.\nCan be installed with 'pip install costsensitive'.")
     _check_constructor_input(base_algorithm, nchoices)
     self.base_algorithm = base_algorithm
     self.nchoices = nchoices
     self.tree = _BinTree(nchoices)
     if c is not None:
         assert isinstance(c, float)
     if pmin is not None:
         assert isinstance(pmin, float)
     self.c = c
     self.pmin = pmin
     self.njobs = _check_njobs(njobs)