class_docstr: Constructs a parameter fitter from an arbitrary callable.
  
  A FunctionParamFitter forwards its X argument to a user-defined
  function (or callable object) and sets the result of this function
  to the ``param`` attribute. This can be useful for stateless
  estimators such as simple conditional parameter selectors.
  
  Note: If a lambda function is used as the ``func``, then the
  resulting estimator will not be pickleable.
  
  Parameters
  ----------
  param : str
      The name of the parameter to set.
  func : callable (X: X_type, **kwargs) -> Any
      The callable to use for the parameter estimation. This will be
      passed the same arguments as estimator, with args and kwargs
      forwarded.
  kw_args : dict, default=None
      Dictionary of additional keyword arguments to pass to func.
  X_type : str, one of "pd.DataFrame, pd.Series, np.ndarray", or list thereof
      default = ["pd.DataFrame", "pd.Series", "np.ndarray"]
      list of types that func is assumed to allow for X (see signature above)
      if X passed to transform/inverse_transform is not on the list,
          it will be converted to the first list element before passed to funcs
  
  See Also
  --------
  sktime.param_est.plugin.PluginParamsForecaster :
      Plugs parameters from a parameter estimator into a forecaster.
  sktime.forecasting.compose.MultiplexForecaster :
      MultiplexForecaster for selecting among different models.
  
  Examples
  --------
  This class could be used to construct a parameter estimator that
  selects a forecaster based on the input data's length. The
  selected forecaster can be stored in the ``selected_forecaster_``
  attribute, which can be then passed down to a
  :class:`~sktime.forecasting.compose.MultiplexForecaster` via a
  :class:`~sktime.param_est.plugin.PluginParamsForecaster`.
  
  >>> import numpy as np
  >>> param_est = FunctionParamFitter(
  ...     param="selected_forecaster",
  ...     func=(
  ...         lambda X, threshold: "naive-seasonal"
  ...         if len(X) >= threshold
  ...         else "naive-last"
  ...     ),
  ...     kw_args={"threshold": 7},
  ... )
  >>> param_est.fit(np.asarray([1, 2, 3, 4]))
  FunctionParamFitter(...)
  >>> param_est.get_fitted_params()
  {'selected_forecaster': 'naive-last'}
  >>> param_est.fit(np.asarray([1, 2, 3, 4, 5, 6, 7]))
  FunctionParamFitter(...)
  >>> param_est.get_fitted_params()
  {'selected_forecaster': 'naive-seasonal'}
  
  The full conditional forecaster selection pipeline could look
  like this:
  
  >>> from sktime.forecasting.compose import MultiplexForecaster
  >>> from sktime.forecasting.naive import NaiveForecaster
  >>> from sktime.param_est.plugin import PluginParamsForecaster
  >>> forecaster = PluginParamsForecaster(
  ...     param_est=param_est,
  ...     forecaster=MultiplexForecaster(
  ...         forecasters=[
  ...             ("naive-last", NaiveForecaster()),
  ...             ("naive-seasonal", NaiveForecaster(sp=7)),
  ...         ]
  ...     ),
  ... )
  >>> forecaster.fit(np.asarray([1, 2, 3, 4]))
  PluginParamsForecaster(...)
  >>> forecaster.predict(fh=[1,2,3])
  array([[4.],
         [4.],
         [4.]])
  >>> forecaster.fit(np.asarray([1, 2, 3, 4, 5, 6, 7]))
  PluginParamsForecaster(...)
  >>> forecaster.predict(fh=[1,2,3])
  array([[1.],
         [2.],
         [3.]])
code: def __init__(self, param, func, kw_args=None, X_type=None):
      self.param = param
      self.func = func
      self.kw_args = kw_args
      self.X_type = X_type
      super().__init__()
  
      if X_type is not None:
          self.set_tags(X_inner_mtype=X_type)
  
imports: from sktime.datatypes import ALL_TIME_SERIES_MTYPES
  from sktime.param_est.base import BaseParamFitter
label_desc: Use image node_id 1 to create a new FunctionParamFitter object from inherited base classes: BaseParamFitter with example: obj = FunctionParamFitter(param, func, kw_args, X_type)