class_docstr: Missing value imputation.
  
  The Imputer transforms input series by replacing missing values according
  to an imputation strategy specified by `method`.
  
  Parameters
  ----------
  method : str, default="drift"
      Method to fill the missing values.
  
      * "drift" : drift/trend values by sktime.PolynomialTrendForecaster(degree=1)
          first, X in transform() is filled with ffill then bfill
          then PolynomialTrendForecaster(degree=1) is fitted to filled X, and
          predict values are queried at indices which had missing values
      * "linear" : linear interpolation, uses pd.Series.interpolate()
          WARNING: This method can not extrapolate, so it is fitted always on the
          data given to transform().
      * "nearest" : use nearest value, uses pd.Series.interpolate()
      * "constant" : same constant value (given in arg value) for all NaN
      * "mean" : pd.Series.mean() of *fit* data
      * "median" : pd.Series.median() of *fit* data
      * "backfill" to "bfill" : adapted from pd.Series.fillna()
      * "pad" or "ffill" : adapted from pd.Series.fillna()
      * "random" : random values between pd.Series.min() and .max() of *fit* data
          if pd.Series dtype is int, sample is uniform discrete
          if pd.Series dtype is float, sample is uniform continuous
      * "forecaster" : use an sktime Forecaster, given in param forecaster.
          First, X in *fit* is filled with ffill then bfill
          then forecaster is fitted to filled X, and *predict* values are queried
          at indices of X data in *transform* which had missing values
      For the following methods, the train data is used to fit them:
      "drift", "mean", "median", "random". For all other methods, the
      transform data is sufficient to compute the impute values.
  
  missing_values : int/float/str, default=None
      The placeholder for the missing values. All occurrences of
      missing_values will be imputed, in addition to np.nan.
      If None, then only np.nan values are imputed.
  value : int/float, default=None
      Value to use to fill missing values when method="constant".
  forecaster : Any Forecaster based on sktime.BaseForecaster, default=None
      Use a given Forecaster to impute by insample predictions when
      method="forecaster". Before fitting, missing data is imputed with
      method="ffill" or "bfill" as heuristic. in case of multivariate X,
      the forecaster is applied separate to each column like a
      ColumnEnsembleForecaster.
  random_state : int/float/str, optional
      Value to set random.seed() if method="random", default None
  
  Examples
  --------
  >>> from sktime.transformations.series.impute import Imputer
  >>> from sktime.datasets import load_airline
  >>> from sktime.split import temporal_train_test_split
  >>> y = load_airline()
  >>> y_train, y_test = temporal_train_test_split(y)
  >>> transformer = Imputer(method="drift")
  >>> transformer.fit(y_train)
  Imputer(...)
  >>> y_test.iloc[3] = np.nan
  >>> y_hat = transformer.transform(y_test)
code: def __init__(
      self,
      method="drift",
      random_state=None,
      value=None,
      forecaster=None,
      missing_values=None,
  ):
      self.method = method
      self.missing_values = missing_values
      self.value = value
      self.forecaster = forecaster
      self.random_state = random_state
      super().__init__()
  
      # these methods require self._X remembered in _fit and _update
      if method in ["drift", "forecaster", "random"]:
          self.set_tags(**{"remember_data": True})
  
      # these methods can be applied to multi-index frames without vectorization or
      # by using an efficient pandas native method
      if method in [
          "constant",
          "mean",
          "median",
          "backfill",
          "bfill",
          "pad",
          "ffill",
      ]:
          self.set_tags(
              **{
                  "X_inner_mtype": [
                      "pd.DataFrame",
                      "pd-multiindex",
                      "pd_multiindex_hier",
                  ]
              }
          )
  
      if method in "forecaster":
          self.set_tags(**{"y_inner_mtype": ["pd.DataFrame"]})
  
file_path: sktime/sktime/transformations/series/impute.py
imports: import numpy
  import pandas
  from sklearn.utils import check_random_state
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.trend import PolynomialTrendForecaster
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 1 to create a new Imputer object from inherited base classes: BaseTransformer with example: obj = Imputer(method, random_state, value, forecaster, missing_values)