class_docstr: Base class for all ensemble classes.
  
  Warning: This class should not be used directly. Use derived classes
  instead.
  
  Parameters
  ----------
  base_estimator : object, optional (default=None)
      The base estimator from which the ensemble is built.
  
  n_estimators : integer
      The number of estimators in the ensemble.
  
  estimator_params : list of strings
      The list of attributes to use as parameters when instantiating a
      new base estimator. If none are given, default parameters are used.
  
  Attributes
  ----------
  base_estimator_ : estimator
      The base estimator from which the ensemble is grown.
  
  estimators_ : list of estimators
      The collection of fitted base estimators.
class_docstr_tok: ["Base","class","for","all","ensemble","classes",".","Warning",":","This","class","should","not","be","used","directly",".","Use","derived","classes","instead",".","Parameters","--","--","--","--","--","base_estimator",":","object",",","optional","(","default=None",")","The","base","estimator","from","which","the","ensemble","is","built",".","n_estimators",":","integer","The","number","of","estimators","in","the","ensemble",".","estimator_params",":","list","of","strings","The","list","of","attributes","to","use","as","parameters","when","instantiating","a","new","base","estimator",".","If","none","are","given",",","default","parameters","are","used",".","Attributes","--","--","--","--","--","base_estimator_",":","estimator","The","base","estimator","from","which","the","ensemble","is","grown",".","estimators_",":","list","of","estimators","The","collection","of","fitted","base","estimators","."]
docstr: Check the estimator and the n_estimator attribute, set the
  `base_estimator_` attribute.
docstr_tok: ["Check","the","estimator","and","the","n_estimator","attribute",",","set","the","`","base_estimator_","`","attribute","."]
code: def _validate_estimator(self, default=None):
      """Check the estimator and the n_estimator attribute, set the
      `base_estimator_` attribute."""
      if not isinstance(
          self.n_estimators, (numbers.Integral, np.integer)
      ):
          raise ValueError(
              "n_estimators must be an integer, "
              "got {0}.".format(type(self.n_estimators))
          )
  
      if self.n_estimators <= 0:
          raise ValueError(
              "n_estimators must be greater than zero, "
              "got {0}.".format(self.n_estimators)
          )
  
      if self.base_estimator is not None:
          self.base_estimator_ = self.base_estimator
      else:
          self.base_estimator_ = default
  
      if self.base_estimator_ is None:
          raise ValueError("base_estimator cannot be None")
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/ensemble/base.py
imports: import numpy
  import numbers
  from ..base import clone
  from ..base import BaseEstimator
  from ..base import MetaEstimatorMixin
  from ..utils import _get_n_jobs, check_random_state
label_desc: Use image node_id 2 for calling the BaseEnsemble obj's underlying member method code with example usage: obj._validate_estimator(default) without return types