docstr: Implementation of two initialization methods.
docstr_tok: ["Implementation","of","two","initialization","methods","."]
code: def _initialize_medoids(
      self, d_matrix, n_clusters, random_state_object
  ):
      """Implementation of two initialization methods."""
  
      if self.init == "random":
          """Randomly chooses K points from existing set of samples"""
          return random_state_object.choice(len(d_matrix), n_clusters)
  
      elif self.init == "heuristic":
          """Chooses initial points as the first K points with shortest total distance to all other points  in the set. Recommended."""
          return np.argpartition(
              np.sum(d_matrix, axis=1), n_clusters - 1
          )[:n_clusters]
  
imports: import warnings
  import numpy
  from sklearn.base import BaseEstimator, ClusterMixin
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.metrics.pairwise import pairwise_distances, pairwise_distances_argmin
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 5 for calling the KMedoids obj's underlying member method code with example usage: obj._initialize_medoids(d_matrix, n_clusters, random_state_object) and returns: random_state_object, np