docs: 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_jobs
          - random_state
          - verbose
          Invalid parameters: (these would require modifying the kernel matrix)
          - knn
          - decay
          - bandwidth
          - bandwidth_scale
          - distance
          - thresh
  
          Parameters
          ----------
          params : key-value pairs of parameter name and new values
  
          Returns
          -------
          self
          """
          if 'knn' in params and params['knn'] != self.knn:
              raise ValueError("Cannot update knn. Please create a new graph")
          if 'decay' in params and params['decay'] != self.decay:
              raise ValueError("Cannot update decay. Please create a new graph")
          if 'bandwidth' in params and params['bandwidth'] != self.bandwidth:
              raise ValueError(
                  "Cannot update bandwidth. Please create a new graph")
          if 'bandwidth_scale' in params and \
                  params['bandwidth_scale'] != self.bandwidth_scale:
              raise ValueError(
                  "Cannot update bandwidth_scale. Please create a new graph")
          if 'distance' in params and params['distance'] != self.distance:
              raise ValueError("Cannot update distance. "
                               "Please create a new graph")
          if 'thresh' in params and params['thresh'] != self.thresh \
                  and self.decay != 0:
              raise ValueError("Cannot update thresh. Please create a new graph")
          if 'n_jobs' in params:
              self.n_jobs = params['n_jobs']
              if hasattr(self, "_knn_tree"):
                  self.knn_tree.set_params(n_jobs=self.n_jobs)
          if 'random_state' in params:
              self.random_state = params['random_state']
          if 'verbose' in params:
              self.verbose = params['verbose']
          # update superclass parameters
          super().set_params(**params)
          return self