def set_params(self, **params):
        """
        Set the parameters of this estimator.
        Valid parameter keys can be listed with ``get_params()``.

        Returns
        -------
        self
        """
        items = self.steps
        names, _ = zip(*items)

        keys = list(six.iterkeys(params))

        for name in keys:
            if '__' not in name and name in names:
                # replace an estimator
                self._replace_estimator('steps', name, params.pop(name))

            if callable(params[name]):
                # use a callable or function to set parameters
                params[name] = params[name](params)

            elif params[name] in keys:
                # set one arg from another
                params[name] = params[params[name]]

        BaseEstimator.set_params(self, **params)
        return self
def set_params ( self , ** params ) : items = self . steps names , _ = zip ( * items ) keys = list ( six . iterkeys ( params ) ) for name in keys : if '__' not in name and name in names : self . _replace_estimator ( 'steps' , name , params . pop ( name ) ) if callable ( params [ name ] ) : params [ name ] = params [ name ] ( params ) elif params [ name ] in keys : params [ name ] = params [ params [ name ] ] BaseEstimator . set_params ( self , ** params ) return self
Set the parameters of this estimator.
        Valid parameter keys can be listed with ``get_params()``.

        Returns
        -------
        self