예제 #1
0
 def __init__(self, q = 10, variables = None):
     
     if not isinstance(q, int):
         raise ValueError('q must be an integer')
         
     self.q = q
     self.variables = _define_variables(variables)
 def __init__(self, imputation_method='median', variables = None):
     
     if imputation_method not in ['median', 'mean']:
         raise ValueError("Imputation method takes only values 'median' or 'mean'")
         
     self.imputation_method = imputation_method
     self.variables = _define_variables(variables)
 def __init__(self, exp = 0.5, variables = None):
     
     if not isinstance(exp, float) and not isinstance(exp, int):
         raise ValueError('exp must be a float or an int')
         
     self.exp = exp
     self.variables = _define_variables(variables)
예제 #4
0
    def __init__(self,
                 variables=None,
                 random_state=None,
                 seed='general',
                 seeding_method='add'):

        if seed not in ['general', 'observation']:
            raise ValueError(
                "seed takes only values 'general' or 'observation'")

        if seeding_method not in ['add', 'multiply']:
            raise ValueError(
                "seeding_method takes only values 'add' or 'multiply'")

        if seed == 'general' and random_state:
            if not isinstance(random_state, int):
                raise ValueError(
                    "if the seed == 'general' the random state must take an integer"
                )

        if isinstance(random_state, str):
            random_state = list(random_state)

        self.variables = _define_variables(variables)
        self.random_state = random_state
        self.seed = seed
        self.seeding_method = seeding_method
 def __init__(self, arbitrary_number = -999, variables = None):
     
     if isinstance(arbitrary_number, int) or isinstance(arbitrary_number, float):
         self.arbitrary_number = arbitrary_number
     else:
         raise ValueError('Arbitrary number must be numeric of type int or float')
     
     self.variables = _define_variables(variables)
    def __init__(self, encoding_method='count', variables=None):

        if encoding_method not in ['count', 'frequency']:
            raise ValueError(
                "encoding_method takes only values 'count' and 'frequency'")

        self.encoding_method = encoding_method
        self.variables = _define_variables(variables)
    def __init__(self, encoding_method='woe', variables=None):

        if encoding_method not in ['woe', 'ratio']:
            raise ValueError(
                "encoding_method takes only values 'woe' and 'ratio'")

        self.encoding_method = encoding_method
        self.variables = _define_variables(variables)
    def __init__(self, encoding_method='ordered', variables=None):

        if encoding_method not in ['ordered', 'arbitrary']:
            raise ValueError(
                "encoding_method takes only values 'ordered' and 'arbitrary'")

        self.encoding_method = encoding_method
        self.variables = _define_variables(variables)
예제 #9
0
 def __init__(self, bins = 10, variables = None, return_object=False):
     
     if not isinstance(bins, int):
         raise ValueError('q must be an integer')
         
     self.bins = bins
     self.variables = _define_variables(variables)
     self.return_object = return_object
예제 #10
0
 def __init__(self, cv = 3, scoring='neg_mean_squared_error', variables = None, regression=True):
     
     if not isinstance(cv, int) or cv < 0:
         raise ValueError('cv can only take only positive integers')
         
     if not isinstance(regression, bool):
         raise ValueError('regression can only True or False')
         
     self.cv = cv
     self.scoring = scoring
     self.regression = regression
     self.variables = _define_variables(variables)
    def __init__(self, tol=0.05, n_categories=10, variables=None):

        if tol < 0 or tol > 1:
            raise ValueError("tol takes values between 0 and 1")

        if n_categories < 0 or not isinstance(n_categories, int):
            raise ValueError(
                "n_categories takes only positive integer numbers")

        self.tol = tol
        self.n_categories = n_categories
        self.variables = _define_variables(variables)
    def __init__(self, top_categories=None, variables=None, drop_last=False):

        if top_categories:
            if not isinstance(top_categories, int):
                raise ValueError(
                    "top_categories takes only integer numbers, 1, 2, 3, etc.")
        self.top_categories = top_categories

        if drop_last not in [True, False]:
            raise ValueError("drop_last takes only True or False")

        self.drop_last = drop_last
        self.variables = _define_variables(variables)
 def __init__(self, distribution='gaussian', tail='right', fold=3, variables = None):
     
     if distribution not in ['gaussian', 'skewed']:
         raise ValueError("distribution takes only values 'gaussian' or 'skewed'")
         
     if tail not in ['right', 'left']:
         raise ValueError("tail takes only values 'right' or 'left'")
         
     if fold <=0 :
         raise ValueError("fold takes only positive numbers")
         
     self.distribution = distribution
     self.tail = tail
     self.fold = fold
     
     self.variables = _define_variables(variables)
예제 #14
0
 def __init__(self, cv = 3, scoring='neg_mean_squared_error',
              variables = None, param_grid = {'max_depth': [1,2,3,4]},
              regression=True, random_state=None):
     
     if not isinstance(cv, int) or cv < 0:
         raise ValueError('cv can only take only positive integers')
         
     if not isinstance(regression, bool):
         raise ValueError('regression can only take True or False')
         
     self.cv = cv
     self.scoring = scoring
     self.regression = regression
     self.variables = _define_variables(variables)
     self.param_grid = param_grid
     self.random_state = random_state
 def __init__(self, variables=None):
     self.variables = _define_variables(variables)
예제 #16
0
    def __init__(self, variables=None, random_state=0):

        self.variables = _define_variables(variables)
        self.random_state = random_state