class_docstr: A utility class for PLDA class used for statistics calculations.
  
  This is also used to pack deep embeddings and meta-information in one object.
  
  Arguments
  ---------
  modelset : list
      List of model IDs for each session as an array of strings.
  segset : list
      List of session IDs as an array of strings.
  start : int
      Index of the first frame of the segment.
  stop : int
      Index of the last frame of the segment.
  stat0 : tensor
      An ndarray of float64. Each line contains 0-th order statistics
      from the corresponding session.
  stat1 : tensor
      An ndarray of float64. Each line contains 1-st order statistics
      from the corresponding session.
docstr: Compute and return the Linear Discriminant Analysis matrix
      on the first-order statistics. Columns of the LDA matrix are ordered
      according to the corresponding eigenvalues in descending order.
  
  Arguments
  ---------
  rank : int
      Rank of the LDA matrix to return.
docstr_tok: ["Compute","and","return","the","Linear","Discriminant","Analysis","matrix","on","the","first-order","statistics",".","Columns","of","the","LDA","matrix","are","ordered","according","to","the","corresponding","eigenvalues","in","descending","order",".","Arguments","--","--","--","--","-","rank",":","int","Rank","of","the","LDA","matrix","to","return","."]
code: def get_lda_matrix_stat1(self, rank):
      """Compute and return the Linear Discriminant Analysis matrix
          on the first-order statistics. Columns of the LDA matrix are ordered
          according to the corresponding eigenvalues in descending order.
  
      Arguments
      ---------
      rank : int
          Rank of the LDA matrix to return.
      """
  
      vect_size = self.stat1.shape[1]
      unique_speaker = numpy.unique(self.modelset)
  
      mu = self.get_mean_stat1()
  
      class_means = numpy.zeros((unique_speaker.shape[0], vect_size))
      Sw = numpy.zeros((vect_size, vect_size))
  
      spk_idx = 0
      for speaker_id in unique_speaker:
          spk_sessions = self.get_model_stat1(speaker_id) - numpy.mean(
              self.get_model_stat1(speaker_id), axis=0
          )
          Sw += (
              numpy.dot(spk_sessions.transpose(), spk_sessions)
              / spk_sessions.shape[0]
          )
          class_means[spk_idx, :] = numpy.mean(
              self.get_model_stat1(speaker_id), axis=0
          )
          spk_idx += 1
  
      # Compute Between-class scatter matrix
      class_means = class_means - mu
      Sb = numpy.dot(class_means.transpose(), class_means)
  
      # Compute the Eigenvectors & eigenvalues of the discrimination matrix
      DiscriminationMatrix = numpy.dot(Sb, linalg.inv(Sw)).transpose()
      eigen_values, eigen_vectors = linalg.eigh(DiscriminationMatrix)
      eigen_values = eigen_values.real
      eigen_vectors = eigen_vectors.real
  
      # Rearrange the eigenvectors according to decreasing eigenvalues
      # get indexes of the rank top eigen values
      idx = eigen_values.real.argsort()[-rank:][::-1]
      L = eigen_vectors[:, idx]
      return L
  
imports: import numpy
  import copy
  import pickle
  from scipy import linalg
label_desc: Use image node_id 18 for calling the StatObject_SB obj's underlying member method code with example usage: obj.get_lda_matrix_stat1(rank) and returns: L