class_docstr: Construct an estimator per data group. Splits data by values of a single column and fits one estimator per such
  column.
  
  Parameters
  ----------
  estimator : scikit-learn compatible estimator/pipeline
      The estimator/pipeline to be applied per group.
  groups : int | str | List[int] | List[str]
      The column(s) of the array/dataframe to select as a grouping parameter set.
  shrinkage : Literal["constant", "min_n_obs", "relative"] | Callable | None, default=None
      How to perform shrinkage:
  
      - `None`: No shrinkage (default)
      - `"constant"`: shrunk prediction for a level is weighted average of its prediction and its parents prediction
      - `"min_n_obs"`: shrunk prediction is the prediction for the smallest group with at least n observations in it
      - `"relative"`: each group-level is weight according to its size
      - `Callable`: a function that takes a list of group lengths and returns an array of the same size with the
          weights for each group
  use_global_model : bool, default=True
  
      - With shrinkage: whether to have a model over the entire input as first group
      - Without shrinkage: whether or not to fall back to a general model in case the group parameter is not found
          during `.predict()`
  check_X : bool, default=True
      Whether to validate `X` to be non-empty 2D array of finite values and attempt to cast `X` to float.
      If disabled, the model/pipeline is expected to handle e.g. missing, non-numeric, or non-finite values.
  **shrinkage_kwargs : dict
      Keyword arguments to the shrinkage function
class_docstr_tok: ["Construct","an","estimator","per","data","group",".","Splits","data","by","values","of","a","single","column","and","fits","one","estimator","per","such","column",".","Parameters","--","--","--","--","--","estimator",":","scikit-learn","compatible","estimator\/pipeline","The","estimator\/pipeline","to","be","applied","per","group",".","groups",":","int","|","str","|","List","[","int","]","|","List","[","str","]","The","column","(","s",")","of","the","array\/dataframe","to","select","as","a","grouping","parameter","set",".","shrinkage",":","Literal","[","``","constant","''",",","``","min_n_obs","''",",","``","relative","''","]","|","Callable","|","None",",","default=None","How","to","perform","shrinkage",":","-","`","None","`",":","No","shrinkage","(","default",")","-","`","``","constant","''","`",":","shrunk","prediction","for","a","level","is","weighted","average","of","its","prediction","and","its","parents","prediction","-","`","``","min_n_obs","''","`",":","shrunk","prediction","is","the","prediction","for","the","smallest","group","with","at","least","n","observations","in","it","-","`","``","relative","''","`",":","each","group-level","is","weight","according","to","its","size","-","`","Callable","`",":","a","function","that","takes","a","list","of","group","lengths","and","returns","an","array","of","the","same","size","with","the","weights","for","each","group","use_global_model",":","bool",",","default=True","-","With","shrinkage",":","whether","to","have","a","model","over","the","entire","input","as","first","group","-","Without","shrinkage",":","whether","or","not","to","fall","back","to","a","general","model","in","case","the","group","parameter","is","not","found","during","`",".predict","(",")","`","check_X",":","bool",",","default=True","Whether","to","validate","`","X","`","to","be","non-empty","2D","array","of","finite","values","and","attempt","to","cast","`","X","`","to","float",".","If","disabled",",","the","model\/pipeline","is","expected","to","handle","e.g",".","missing",",","non-numeric",",","or","non-finite","values",".","*","*","shrinkage_kwargs",":","dict","Keyword","arguments","to","the","shrinkage","function"]
docstr: Predict target values on new data `X` by predicting on each group. If a group is not found during
  `.predict()` and `use_global_model=True` the fallback estimator will be used. If `use_global_model=False` a
  `ValueError` will be raised.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Data to predict.
  
  Returns
  -------
  array-like of shape (n_samples,)
      Predicted target values.
docstr_tok: ["Predict","target","values","on","new","data","`","X","`","by","predicting","on","each","group",".","If","a","group","is","not","found","during","`",".predict","(",")","`","and","`","use_global_model=True","`","the","fallback","estimator","will","be","used",".","If","`","use_global_model=False","`","a","`","ValueError","`","will","be","raised",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Data","to","predict",".","Returns","--","--","--","-","array-like","of","shape","(","n_samples",",",")","Predicted","target","values","."]
code: def predict(self, X):
      """Predict target values on new data `X` by predicting on each group. If a group is not found during
      `.predict()` and `use_global_model=True` the fallback estimator will be used. If `use_global_model=False` a
      `ValueError` will be raised.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          Data to predict.
  
      Returns
      -------
      array-like of shape (n_samples,)
          Predicted target values.
      """
      check_is_fitted(self, ["estimators_", "groups_", "fallback_"])
  
      X_group, X_value = _split_groups_and_values(
          X,
          self.groups,
          min_value_cols=0,
          check_X=self.check_X,
          **self._check_kwargs,
      )
  
      X_group = self.__add_shrinkage_column(X_group)
  
      if self.shrinkage is None:
          return self.__predict_groups(
              X_group, X_value, method="predict"
          )
      else:
          return self.__predict_shrinkage_groups(
              X_group, X_value, method="predict"
          )
  
imports: import numpy
  import pandas
  from sklearn import clone
  from sklearn.base import BaseEstimator, is_classifier
  from sklearn.utils.metaestimators import available_if
  from sklearn.utils.validation import check_array, check_is_fitted
  from sklego.common import as_list, expanding_list
  from sklego.meta._grouped_utils import _split_groups_and_values, constant_shrinkage, min_n_obs_shrinkage, relative_shrinkage
label_desc: Use image node_id 13 for calling the GroupedPredictor obj's underlying member method code with example usage: obj.predict(X) and returns: self, self