code: def fit(self, X):
          
          D = self._initialize(X)
          for i in range(self.max_iter):
              gamma = self._transform(D, X)
              e = np.linalg.norm(X - gamma.dot(D))
              if e < self.tol:
                  break
              D, gamma = self._update_dict(X, D, gamma)
  
          self.components_ = D
          return self
docs: Parameters
          ----------
          X: shape = [n_samples, n_features]