code: def fit(self, X, y=None, groups=None):
      # Checks groups are provided
      self.groups_ = self._determine_groups(X, groups)
  
      # Check input
      self._check_input(X)
  
      # Check group types are consistent
      self.all_nums_ = {}
      for name, cols in sorted(self.groups_.items()):
          all_num = all(
              pd.api.types.is_numeric_dtype(X[c]) for c in cols
          )
          all_cat = all(
              pd.api.types.is_string_dtype(X[c]) for c in cols
          )
          if not (all_num or all_cat):
              raise ValueError(
                  f'Not all columns in "{name}" group are of the same type'
              )
          self.all_nums_[name] = all_num
  
      # Normalize column-wise
      X = (X - X.mean()) / ((X - X.mean()) ** 2).sum() ** 0.5
  
      # Run a factor analysis in each group
      for name, cols in sorted(self.groups_.items()):
          if self.all_nums_[name]:
              fa = pca.PCA(
                  rescale_with_mean=True,
                  rescale_with_std=True,
                  n_components=self.n_components,
                  n_iter=self.n_iter,
                  copy=True,
                  random_state=self.random_state,
                  engine=self.engine,
              )
          else:
              raise NotImplementedError(
                  "Groups of non-numerical variables are not supported yet"
              )
          self[name] = fa.fit(X.loc[:, cols])
  
      # Fit the global PCA
      Z = pd.concat(
          (
              X[cols] / self[g].eigenvalues_[0] ** 0.5
              for g, cols in self.groups_.items()
          ),
          axis="columns",
      )
      super().fit(Z)
      self.total_inertia_ = sum(self.eigenvalues_)
  
      # TODO: column_coordinates_ is not implemented yet
      delattr(self, "column_coordinates_")
  
      return self
  
imports: from __future__ import annotations
  import collections
  import altair
  import numpy
  import pandas
  import sklearn.utils
  from prince import pca, utils
label_desc: Use image node_id 3 for calling the MFA obj's underlying member method code with example usage: obj.fit(X, y, groups) and returns: self