code: def dbscan_hyperparameters(
      embeddings, e_lower=0.3, e_upper=0.8, m_lower=3, m_upper=15
  ):
      """
      function to run dbscan clustering greedily for different min_samples and e_eps and discover number of resulting clusters and noise points
      """
      n_clusters_res = []
      n_noise_res = []
      e_res = []
      m_res = []
  
      for e in np.arange(e_lower, e_upper, 0.1):
          print("eps:" + str(e))
          for m in np.arange(m_lower, m_upper, 1):
              db = DBSCAN(eps=e, min_samples=m).fit(embeddings)
              labels = db.labels_
              n_clusters_ = len(set(labels)) - (
                  1 if -1 in labels else 0
              )
              n_noise_ = list(labels).count(-1)
              n_clusters_res.append(n_clusters_)
              n_noise_res.append(n_noise_)
              e_res.append(e)
              m_res.append(m)
  
      plt.plot(n_clusters_res, n_noise_res, "ro")
      plt.xlabel("Number of clusters")
      plt.ylabel("Number of noise points")
      plt.show()
  
      dt = pd.DataFrame(
          {
              "n_clusters": n_clusters_res,
              "n_noise": n_noise_res,
              "eps": e_res,
              "min_samples": m_res,
          }
      )
  
      return dt
  
file_path: stellargraph/demos/community_detection/utils.py
imports: import pandas
  import numpy
  import random
  import networkx
  from sklearn.cluster import DBSCAN
  from functools import reduce
  import matplotlib.pyplot
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: dbscan_hyperparameters(embeddings, e_lower, e_upper, m_lower, m_upper) and returns: dt