docstr: Display a shap plot summary for each horizon and each component dimension of the target.
  This method reuses the initial background data as foreground (potentially sampled) to give a general importance
  plot for each feature.
  If no target names and/or no horizons are provided, all summary plots are produced.
  
  Parameters
  ----------
  horizons
      Optionally, an integer or sequence of integers representing which points/steps in the future to explain,
      starting from the first prediction step at 1. `horizons` must `<=output_chunk_length` of the forecasting
      model.
  target_components
      Optionally, a string or sequence of strings with the target components to explain.
  num_samples
      Optionally, an integer for sampling the foreground series (based on the background),
      for the sake of performance.
  plot_type
      Optionally, specify which of the shap library plot type to use. Can be one of ``'dot', 'bar', 'violin'``.
  
  Returns
  -------
  shaps_
      A nested dictionary {horizon : {component : shap.Explaination}} containing the raw Explanations for all
      the horizons and components.
docstr_tok: ["Display","a","shap","plot","summary","for","each","horizon","and","each","component","dimension","of","the","target",".","This","method","reuses","the","initial","background","data","as","foreground","(","potentially","sampled",")","to","give","a","general","importance","plot","for","each","feature",".","If","no","target","names","and\/or","no","horizons","are","provided",",","all","summary","plots","are","produced",".","Parameters","--","--","--","--","--","horizons","Optionally",",","an","integer","or","sequence","of","integers","representing","which","points\/steps","in","the","future","to","explain",",","starting","from","the","first","prediction","step","at","1",".","`","horizons","`","must","`","<","=output_chunk_length","`","of","the","forecasting","model",".","target_components","Optionally",",","a","string","or","sequence","of","strings","with","the","target","components","to","explain",".","num_samples","Optionally",",","an","integer","for","sampling","the","foreground","series","(","based","on","the","background",")",",","for","the","sake","of","performance",".","plot_type","Optionally",",","specify","which","of","the","shap","library","plot","type","to","use",".","Can","be","one","of","``","'dot","'",",","'bar","'",",","'violin","'","``",".","Returns","--","--","--","-","shaps_","A","nested","dictionary","{","horizon",":","{","component",":","shap.Explaination","}","}","containing","the","raw","Explanations","for","all","the","horizons","and","components","."]
code: def summary_plot(
      self,
      horizons: Optional[Union[int, Sequence[int]]] = None,
      target_components: Optional[Union[str, Sequence[str]]] = None,
      num_samples: Optional[int] = None,
      plot_type: Optional[str] = "dot",
      **kwargs,
  ) -> Dict[int, Dict[str, shap.Explanation]]:
      """
      Display a shap plot summary for each horizon and each component dimension of the target.
      This method reuses the initial background data as foreground (potentially sampled) to give a general importance
      plot for each feature.
      If no target names and/or no horizons are provided, all summary plots are produced.
  
      Parameters
      ----------
      horizons
          Optionally, an integer or sequence of integers representing which points/steps in the future to explain,
          starting from the first prediction step at 1. `horizons` must `<=output_chunk_length` of the forecasting
          model.
      target_components
          Optionally, a string or sequence of strings with the target components to explain.
      num_samples
          Optionally, an integer for sampling the foreground series (based on the background),
          for the sake of performance.
      plot_type
          Optionally, specify which of the shap library plot type to use. Can be one of ``'dot', 'bar', 'violin'``.
  
      Returns
      -------
      shaps_
          A nested dictionary {horizon : {component : shap.Explaination}} containing the raw Explanations for all
          the horizons and components.
      """
  
      horizons, target_components = self._process_horizons_and_targets(
          horizons, target_components
      )
  
      if num_samples:
          foreground_X_sampled = shap.utils.sample(
              self.explainers.background_X, num_samples
          )
      else:
          foreground_X_sampled = self.explainers.background_X
  
      shaps_ = self.explainers.shap_explanations(
          foreground_X_sampled, horizons, target_components
      )
  
      for t in target_components:
          for h in horizons:
              plt.title(
                  "Target: `{}` - Horizon: {}".format(t, "t+" + str(h))
              )
              shap.summary_plot(
                  shaps_[h][t],
                  foreground_X_sampled,
                  plot_type=plot_type,
                  **kwargs,
              )
      return shaps_
  
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 3 for calling the ShapExplainer obj's underlying member method code with example usage: obj.summary_plot(horizons, target_components, num_samples, plot_type) and returns: shaps_