tools/perf/experimental/story_clustering/cluster_stories.py
def GetRepresentative(self, distance_matrix=None):
    """Finds and sets the representative of cluster.

    The story which its max distance to all other members is minimum is
    used as the representative.

    Args:
      distance_matrix: A dataframe containing the distances between any
      two stories.

    Returns:
      A story which is the representative of cluster
    """
    if self._representative:
      return self._representative

    if distance_matrix is None:
      raise Exception('Distance matrix is not set.')

    self._representative = distance_matrix.loc[
      self._members, self._members].sum().idxmin()
    return self._representative
Finds and sets the representative of cluster.

    The story which its max distance to all other members is minimum is
    used as the representative.

    Args:
      distance_matrix: A dataframe containing the distances between any
      two stories.

    Returns:
      A story which is the representative of cluster
    
Finds and sets the representative of cluster.
The story which its max distance to all other members is minimum is
used as the representative.

A dataframe containing the distances between any
two stories.

A story which is the representative of cluster
Finds and sets the representative of cluster . The story which its max distance to all other members is minimum is used as the representative . A dataframe containing the distances between any two stories . A story which is the representative of cluster
def GetRepresentative(self, distance_matrix=None):
    if self._representative:
      return self._representative
    if distance_matrix is None:
      raise Exception('Distance matrix is not set.')
    self._representative = distance_matrix.loc[
      self._members, self._members].sum().idxmin()
    return self._representative
def GetRepresentative ( self , distance_matrix = None ) : if self . _representative : return self . _representative if distance_matrix is None : raise Exception ( 'Distance matrix is not set.' ) self . _representative = distance_matrix . loc [ self . _members , self . _members ] . sum ( ) . idxmin ( ) return self . _representative
Finds and sets the representative of cluster.
Finds and sets the representative of cluster .
"""Finds and sets the representative of cluster.

    The story which its max distance to all other members is minimum is
    used as the representative.

    Args:
      distance_matrix: A dataframe containing the distances between any
      two stories.

    Returns:
      A story which is the representative of cluster
    """
self
distance_matrix