def set_params(self, **params):
        """Set parameters on this object

        Safe setter method - attributes should not be modified directly as some
        changes are not valid.
        Valid parameters:
        - n_pca
        - random_state

        Parameters
        ----------
        params : key-value pairs of parameter name and new values

        Returns
        -------
        self
        """
        if 'n_pca' in params and params['n_pca'] != self.n_pca:
            raise ValueError("Cannot update n_pca. Please create a new graph")
        if 'random_state' in params:
            self.random_state = params['random_state']
        super().set_params(**params)
        return self
def set_params ( self , ** params ) : if 'n_pca' in params and params [ 'n_pca' ] != self . n_pca : raise ValueError ( "Cannot update n_pca. Please create a new graph" ) if 'random_state' in params : self . random_state = params [ 'random_state' ] super ( ) . set_params ( ** params ) return self
Set parameters on this object

        Safe setter method - attributes should not be modified directly as some
        changes are not valid.
        Valid parameters:
        - n_pca
        - random_state

        Parameters
        ----------
        params : key-value pairs of parameter name and new values

        Returns
        -------
        self