class_docstr: Base class for all estimators in scikit-learn
  Notes
  -----
  All estimators should specify all the parameters that can be set
  at the class level in their ``__init__`` as explicit keyword
  arguments (no ``*args`` or ``**kwargs``).
docstr: Set the parameters of this estimator.
  The method works on simple estimators as well as on nested objects
  (such as pipelines). The latter have parameters of the form
  ``<component>__<parameter>`` so that it's possible to update each
  component of a nested object.
  Returns
  -------
  self
docstr_tok: ["Set","the","parameters","of","this","estimator",".","The","method","works","on","simple","estimators","as","well","as","on","nested","objects","(","such","as","pipelines",")",".","The","latter","have","parameters","of","the","form","``","<","component",">","__","<","parameter",">","``","so","that","it","'s","possible","to","update","each","component","of","a","nested","object",".","Returns","--","--","--","-","self"]
code: def set_params(self, **params):
      """Set the parameters of this estimator.
      The method works on simple estimators as well as on nested objects
      (such as pipelines). The latter have parameters of the form
      ``<component>__<parameter>`` so that it's possible to update each
      component of a nested object.
      Returns
      -------
      self
      """
      if not params:
          # Simple optimization to gain speed (inspect is slow)
          return self
      valid_params = self.get_params(deep=True)
  
      nested_params = defaultdict(dict)  # grouped by prefix
      for key, value in params.items():
          key, delim, sub_key = key.partition("__")
          if key not in valid_params:
              raise ValueError(
                  "Invalid parameter %s for estimator %s. "
                  "Check the list of available parameters "
                  "with `estimator.get_params().keys()`." % (key, self)
              )
  
          if delim:
              nested_params[key][sub_key] = value
          else:
              setattr(self, key, value)
              valid_params[key] = value
  
      for key, sub_params in nested_params.items():
          valid_params[key].set_params(**sub_params)
  
      return self
  
imports: import copy
  import warnings
  from collections import defaultdict
  import numpy
  from scipy import sparse
  from ..None import six
  from ..funcsigs import signature
label_desc: Use image node_id 3 for calling the BaseEstimator obj's underlying member method code with example usage: obj.set_params() and returns: self, self