class_docstr: Manages issues related to out-of-distribution examples.
class_docstr_tok: ["Manages","issues","related","to","out-of-distribution","examples","."]
code: def collect_info(
      self, *, knn_graph: Optional[csr_matrix] = None
  ) -> dict:
      issues_dict = {
          "average_ood_score": self.issues[self.issue_score_key].mean(),
          "threshold": self.threshold,
      }
      pred_probs_issues_dict: Dict[str, Any] = {}
      feature_issues_dict = {}
  
      if knn_graph is not None:
          knn = self.ood.params["knn"]  # type: ignore
          N = knn_graph.shape[0]
          k = knn_graph.nnz // N
          dists = knn_graph.data.reshape(N, -1)[:, 0]
          nn_ids = knn_graph.indices.reshape(N, -1)[:, 0]
  
          feature_issues_dict.update(
              {
                  "k": k,  # type: ignore[union-attr]
                  "nearest_neighbor": nn_ids.tolist(),
                  "distance_to_nearest_neighbor": dists.tolist(),
              }
          )
          if self.ood.params["knn"] is not None:
              knn = self.ood.params["knn"]
              feature_issues_dict.update({"metric": knn.metric})  # type: ignore[union-attr]
  
      if self.ood.params["confident_thresholds"] is not None:
          pass  #
      statistics_dict = self._build_statistics_dictionary(
          knn_graph=knn_graph
      )
      ood_params_dict = self.ood.params
      knn_dict = {
          **pred_probs_issues_dict,
          **feature_issues_dict,
      }
      info_dict: Dict[str, Any] = {
          **issues_dict,
          **ood_params_dict,  # type: ignore[arg-type]
          **knn_dict,
          **statistics_dict,
      }
      return info_dict
  
file_path: cleanlab/cleanlab/datalab/internal/issue_manager/outlier.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, ClassVar, Dict, Optional, Tuple, Union, cast
  from scipy.sparse import csr_matrix
  from scipy.stats import iqr
  import numpy
  import pandas
  from cleanlab.datalab.internal.issue_manager import IssueManager
  from cleanlab.outlier import OutOfDistribution, transform_distances_to_scores
label_desc: Use image node_id 6 for calling the OutlierIssueManager obj's underlying member method code with example usage: obj.collect_info() and returns: info_dict