class_docstr: Manages issues related to near-duplicate examples.
class_docstr_tok: ["Manages","issues","related","to","near-duplicate","examples","."]
code: def collect_info(
      self, knn_graph: csr_matrix, median_nn_distance: float
  ) -> dict:
      issues_dict = {
          "average_near_duplicate_score": self.issues[
              self.issue_score_key
          ].mean(),
          "near_duplicate_sets": self.near_duplicate_sets,
      }
  
      params_dict = {
          "metric": self.metric,
          "k": self.k,
          "threshold": self.threshold,
      }
  
      N = knn_graph.shape[0]
      dists = knn_graph.data.reshape(N, -1)[:, 0]
      nn_ids = knn_graph.indices.reshape(N, -1)[:, 0]
  
      knn_info_dict = {
          "nearest_neighbor": nn_ids.tolist(),
          "distance_to_nearest_neighbor": dists.tolist(),
          "median_distance_to_nearest_neighbor": median_nn_distance,
      }
  
      statistics_dict = self._build_statistics_dictionary(
          knn_graph=knn_graph
      )
  
      info_dict = {
          **issues_dict,
          **params_dict,
          **knn_info_dict,
          **statistics_dict,
      }
      return info_dict
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Union
  import warnings
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.neighbors import NearestNeighbors
  from sklearn.exceptions import NotFittedError
  from sklearn.utils.validation import check_is_fitted
  from cleanlab.datalab.internal.issue_manager import IssueManager
label_desc: Use image node_id 5 for calling the NearDuplicateIssueManager obj's underlying member method code with example usage: obj.collect_info(knn_graph, median_nn_distance) and returns: info_dict