class_docstr: Construct a transformer per data group. Splits data by groups from single or multiple columns and transforms
  remaining columns using the transformers corresponding to the groups.
  
  Parameters
  ----------
  transformer : scikit-learn compatible transformer
      The transformer to be applied per group.
  groups : int | str | List[int] | List[str] | None
      The column(s) of the array/dataframe to select as a grouping parameter set. If `None`, the transformer will be
      applied to the entire input without grouping.
  use_global_model : bool, default=True
      Whether or not to fall back to a general transformation in case a group is not found during `.transform()`.
  
  Attributes
  ----------
  transformers_ : scikit-learn compatible transformer | dict[..., scikit-learn compatible transformer]
      The fitted transformers per group or a single fitted transformer if `groups` is `None`.
  fallback_ : scikit-learn compatible transformer | None
      The fitted transformer to fall back to in case a group is not found during `.transform()`. Only present if
      `use_global_model` is `True`.
docstr: Fit a transformer to each group
docstr_tok: ["Fit","a","transformer","to","each","group"]
code: def __fit_grouped_transformer(
      self, X_group: pd.DataFrame, X_value: np.ndarray, y=None
  ):
      """Fit a transformer to each group"""
      # Make the groups based on the groups dataframe, use the indices on the values array
      try:
          group_indices = X_group.groupby(
              X_group.columns.tolist()
          ).indices
      except TypeError:
          # This one is needed because of line #918 of sklearn/utils/estimator_checks
          raise TypeError("argument must be a string, date or number")
  
      if y is not None:
          if isinstance(y, pd.Series):
              y.index = X_group.index
  
          grouped_transformers = {
              # Fit a clone of the transformer to each group
              group: self.__fit_single_group(
                  group, X_value[indices, :], y[indices]
              )
              for group, indices in group_indices.items()
          }
      else:
          grouped_transformers = {
              group: self.__fit_single_group(group, X_value[indices, :])
              for group, indices in group_indices.items()
          }
  
      return grouped_transformers
  
file_path: scikit-lego/sklego/meta/grouped_transformer.py
imports: import numpy
  import pandas
  from sklearn.base import BaseEstimator, TransformerMixin, clone
  from sklearn.utils.validation import check_is_fitted
  from sklego.meta._grouped_utils import _split_groups_and_values
label_desc: Use image node_id 3 for calling the GroupedTransformer obj's underlying member method code with example usage: obj.__fit_grouped_transformer(X_group, X_value, y) and returns: grouped_transformers