code: def fit(self):
          
  
          self.n_samples, self.n_features = self.ms.shape
          self.u, self.s, self.vt = np.linalg.svd(self.ms, full_matrices=False)
          self.v = self.vt.T
  
          # sklearn's implementation is to guarantee that the left and right
          # singular vectors (U and V) are always the same, by imposing the
          # that the largest coefficient of U in absolute value is positive
          # This implementation uses u_based_decision=False rather than the
          # default True to flip that logic and ensure the resulting
          # components and loadings have high positive coefficients
          self.u, self.vt = svd_flip(
              self.u, self.v, u_based_decision=self.u_based_decision
          )
          self.v = self.vt.T
  
          # Drop eigenvalues with value > threshold
          # *keep* is number of components retained
          self.eigenvalues = self.s ** 2 / self.n_samples
          self.keep = np.count_nonzero(self.eigenvalues > self.threshold)
  
          self.inertia = (self.eigenvalues / self.eigenvalues.sum())[: self.keep]
          self.cumulative_inertia = self.inertia.cumsum()[: self.keep]
          self.eigenvalues = self.eigenvalues[: self.keep]
  
          return self
docs: Fit the model by computing full SVD on m.
  
          SVD factors the matrix m as u * np.diag(s) * v, where u and v are
          unitary and s is a 1-d array of m‘s singular values.  Note that the SVD
          is commonly written as a = U S V.H, and the v returned by this function
          is V.H (the Hermitian transpose).  Therefore, we denote V.H as vt, and
          back into the actual v, denoted just v.
  
          The decomposition uses np.linalg.svd with full_matrices=False, so for
          m with shape (M, N), then the shape of:
           - u is (M, K)
           - v is (K, N
          where K = min(M, N)
  
          Intertia is the percentage of explained variance.
  
          Returns
          -------
          self, to enable method chaining