class_docstr: Helper Class to wrap the different cases encountered with shap different explainers, multivariates,
  horizon etc.
  Aim to provide shap values for any type of RegressionModel. Manage the MultioutputRegressor cases.
  For darts RegressionModel only.
docstr: Creates the shap format input for regression models.
  The output is a pandas DataFrame representing all lags of different covariates, and with adequate
  column names in order to map feature / shap values.
  It uses create_lagged_data also used in RegressionModel to build the tabular dataset.
docstr_tok: ["Creates","the","shap","format","input","for","regression","models",".","The","output","is","a","pandas","DataFrame","representing","all","lags","of","different","covariates",",","and","with","adequate","column","names","in","order","to","map","feature","\/","shap","values",".","It","uses","create_lagged_data","also","used","in","RegressionModel","to","build","the","tabular","dataset","."]
code: def _create_regression_model_shap_X(
      self,
      target_series: Optional[Union[TimeSeries, Sequence[TimeSeries]]],
      past_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ],
      future_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ],
      n_samples: Optional[int] = None,
      train: bool = False,
  ) -> pd.DataFrame:
      """
      Creates the shap format input for regression models.
      The output is a pandas DataFrame representing all lags of different covariates, and with adequate
      column names in order to map feature / shap values.
      It uses create_lagged_data also used in RegressionModel to build the tabular dataset.
  
      """
  
      lags_list = self.model._get_lags("target")
      lags_past_covariates_list = self.model._get_lags("past")
      lags_future_covariates_list = self.model._get_lags("future")
  
      X, indexes = create_lagged_prediction_data(
          target_series=target_series if lags_list else None,
          past_covariates=past_covariates
          if lags_past_covariates_list
          else None,
          future_covariates=future_covariates
          if lags_future_covariates_list
          else None,
          lags=lags_list,
          lags_past_covariates=lags_past_covariates_list
          if past_covariates
          else None,
          lags_future_covariates=lags_future_covariates_list
          if future_covariates
          else None,
          uses_static_covariates=self.model.uses_static_covariates,
          last_static_covariates_shape=self.model._static_covariates_shape,
      )
      # Remove sample axis:
      X = X[:, :, 0]
  
      if train:
          X = pd.DataFrame(X)
          if len(X) <= MIN_BACKGROUND_SAMPLE:
              raise_log(
                  ValueError(
                      "The number of samples in the background dataset is too small to compute shap values."
                  )
              )
      else:
          X = pd.DataFrame(X, index=indexes[0])
  
      if n_samples:
          X = shap.utils.sample(X, n_samples)
  
      # rename output columns to the matching lagged features names
      X = X.rename(
          columns={
              name: self.model.lagged_feature_names[idx]
              for idx, name in enumerate(X.columns.to_list())
          }
      )
      return X
  
imports: from enum import Enum
  from typing import Dict, NewType, Optional, Sequence, Union
  import matplotlib.pyplot
  import pandas
  import shap
  from sklearn.multioutput import MultiOutputRegressor
  from darts import TimeSeries
  from darts.explainability.explainability import _ForecastingModelExplainer
  from darts.explainability.explainability_result import ShapExplainabilityResult
  from darts.logging import get_logger, raise_if, raise_log
  from darts.models.forecasting.regression_model import RegressionModel
  from darts.utils.data.tabularization import create_lagged_prediction_data
label_desc: Use image node_id 4 for calling the _RegressionShapExplainers obj's underlying member method code with example usage: obj._create_regression_model_shap_X(target_series, past_covariates, future_covariates, n_samples, train) and returns: X