def set_params(self, **kwargs) -> None:
        """
        Take a dictionary of parameters and apply checks before setting them as attributes.

        :param kwargs: A dictionary of attributes.
        """
        for key, value in kwargs.items():
            if key in self.estimator_params:
                if hasattr(type(self), key) and isinstance(getattr(type(self), key), property):
                    if getattr(type(self), key).fset is not None:
                        setattr(self, key, value)
                    else:
                        setattr(self, "_" + key, value)
                elif hasattr(self, "_" + key):
                    setattr(self, "_" + key, value)
                else:
                    if key == "preprocessing":
                        setattr(self, key, self._set_preprocessing(value))
                    elif key == "preprocessing_defences":
                        setattr(self, key, self._set_preprocessing_defences(value))
                    elif key == "postprocessing_defences":
                        setattr(self, key, self._set_postprocessing_defences(value))
                    else:
                        setattr(self, key, value)
            else:  # pragma: no cover
                raise ValueError(f"Unexpected parameter `{key}` found in kwargs.")
        self._update_preprocessing_operations()
        self._check_params()

        Take a dictionary of parameters and apply checks before setting them as attributes.

        :param kwargs: A dictionary of attributes.
        
art/estimators/estimator.py