Exemple #1
0
 def __init__(self,
              base_algorithm,
              nchoices,
              c=None,
              pmin=1e-5,
              random_state=1,
              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.random_state = _check_random_state(random_state)
     self.njobs = _check_njobs(njobs)
     self.is_fitted = False
Exemple #2
0
 def __init__(self, base_algorithm, nchoices, c=None, pmin=1e-5):
     _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