Set the parameters of this estimator.

        Returns
        -------

        self

def set_params(self, **params):
        """
        Set the parameters of this estimator.

        Returns
        -------

        self
        """

        valid_params = self.get_params()

        for key, value in params.items():
            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.__class__.__name__)
                )

            setattr(self, key, value)

        return self