'Check validity of parameters and raise ValueError if not valid.'

def _check_params(self):

    if (self.n_estimators <= 0):
        raise ValueError(('n_estimators    must    be    greater    than    0    but    was    %r' % self.n_estimators))
    if (self.learning_rate <= 0.0):
        raise ValueError(('learning_rate    must    be    greater    than    0    but    was    %r' % self.learning_rate))
    if ((self.loss not in self._SUPPORTED_LOSS) or (self.loss not in LOSS_FUNCTIONS)):
        raise ValueError("Loss    '{0:s}'    not    supported.    ".format(self.loss))
    if (self.loss == 'deviance'):
        loss_class = (MultinomialDeviance if (len(self.classes_) > 2) else BinomialDeviance)
    else:
        loss_class = LOSS_FUNCTIONS[self.loss]
    if (self.loss in ('huber', 'quantile')):
        self.loss_ = loss_class(self.n_classes_, self.alpha)
    else:
        self.loss_ = loss_class(self.n_classes_)
    if (not (0.0 < self.subsample <= 1.0)):
        raise ValueError(('subsample    must    be    in    (0,1]    but    was    %r' % self.subsample))
    if (self.init is not None):
        if isinstance(self.init, six.string_types):
            if (self.init not in INIT_ESTIMATORS):
                raise ValueError(('init="%s"    is    not    supported' % self.init))
        elif ((not hasattr(self.init, 'fit')) or (not hasattr(self.init, 'predict'))):
            raise ValueError(('init=%r    must    be    valid    BaseEstimator    and    support    both    fit    and    predict' % self.init))
    if (not (0.0 < self.alpha < 1.0)):
        raise ValueError(('alpha    must    be    in    (0.0,    1.0)    but    was    %r' % self.alpha))
    if isinstance(self.max_features, six.string_types):
        if (self.max_features == 'auto'):
            if (self.n_classes_ > 1):
                max_features = max(1, int(np.sqrt(self.n_features_)))
            else:
                max_features = self.n_features_
        elif (self.max_features == 'sqrt'):
            max_features = max(1, int(np.sqrt(self.n_features_)))
        elif (self.max_features == 'log2'):
            max_features = max(1, int(np.log2(self.n_features_)))
        else:
            raise ValueError(("Invalid    value    for    max_features:    %r.    Allowed    string    values    are    'auto',    'sqrt'    or    'log2'." % self.max_features))
    elif (self.max_features is None):
        max_features = self.n_features_
    elif isinstance(self.max_features, (numbers.Integral, np.integer)):
        max_features = self.max_features
    elif (0.0 < self.max_features <= 1.0):
        max_features = max(int((self.max_features * self.n_features_)), 1)
    else:
        raise ValueError('max_features    must    be    in    (0,    n_features]')
    self.max_features_ = max_features
    if (not isinstance(self.n_iter_no_change, (numbers.Integral, np.integer, type(None)))):
        raise ValueError(('n_iter_no_change    should    either    be    None    or    an    integer.    %r    was    passed' % self.n_iter_no_change))
