class_docstr: Base class for defining estimators in sktime.
  
  Extends sktime's BaseObject to include basic functionality for fittable estimators.
class_docstr_tok: ["Base","class","for","defining","estimators","in","sktime",".","Extends","sktime","'s","BaseObject","to","include","basic","functionality","for","fittable","estimators","."]
docstr: Get fitted parameters.
  
  State required:
      Requires state to be "fitted".
  
  Parameters
  ----------
  deep : bool, default=True
      Whether to return fitted parameters of components.
  
      * If True, will return a dict of parameter name : value for this object,
        including fitted parameters of fittable components
        (= BaseEstimator-valued parameters).
      * If False, will return a dict of parameter name : value for this object,
        but not include fitted parameters of components.
  
  Returns
  -------
  fitted_params : dict with str-valued keys
      Dictionary of fitted parameters, paramname : paramvalue
      keys-value pairs include:
  
      * always: all fitted parameters of this object, as via `get_param_names`
        values are fitted parameter value for that key, of this object
      * if `deep=True`, also contains keys/value pairs of component parameters
        parameters of components are indexed as `[componentname]__[paramname]`
        all parameters of `componentname` appear as `paramname` with its value
      * if `deep=True`, also contains arbitrary levels of component recursion,
        e.g., `[componentname]__[componentcomponentname]__[paramname]`, etc
docstr_tok: ["Get","fitted","parameters",".","State","required",":","Requires","state","to","be","``","fitted","''",".","Parameters","--","--","--","--","--","deep",":","bool",",","default=True","Whether","to","return","fitted","parameters","of","components",".","*","If","True",",","will","return","a","dict","of","parameter","name",":","value","for","this","object",",","including","fitted","parameters","of","fittable","components","(","=","BaseEstimator-valued","parameters",")",".","*","If","False",",","will","return","a","dict","of","parameter","name",":","value","for","this","object",",","but","not","include","fitted","parameters","of","components",".","Returns","--","--","--","-","fitted_params",":","dict","with","str-valued","keys","Dictionary","of","fitted","parameters",",","paramname",":","paramvalue","keys-value","pairs","include",":","*","always",":","all","fitted","parameters","of","this","object",",","as","via","`","get_param_names","`","values","are","fitted","parameter","value","for","that","key",",","of","this","object","*","if","`","deep=True","`",",","also","contains","keys\/value","pairs","of","component","parameters","parameters","of","components","are","indexed","as","`","[","componentname","]","__","[","paramname","]","`","all","parameters","of","`","componentname","`","appear","as","`","paramname","`","with","its","value","*","if","`","deep=True","`",",","also","contains","arbitrary","levels","of","component","recursion",",","e.g.",",","`","[","componentname","]","__","[","componentcomponentname","]","__","[","paramname","]","`",",","etc"]
code: def get_fitted_params(self, deep=True):
      """Get fitted parameters.
  
      State required:
          Requires state to be "fitted".
  
      Parameters
      ----------
      deep : bool, default=True
          Whether to return fitted parameters of components.
  
          * If True, will return a dict of parameter name : value for this object,
            including fitted parameters of fittable components
            (= BaseEstimator-valued parameters).
          * If False, will return a dict of parameter name : value for this object,
            but not include fitted parameters of components.
  
      Returns
      -------
      fitted_params : dict with str-valued keys
          Dictionary of fitted parameters, paramname : paramvalue
          keys-value pairs include:
  
          * always: all fitted parameters of this object, as via `get_param_names`
            values are fitted parameter value for that key, of this object
          * if `deep=True`, also contains keys/value pairs of component parameters
            parameters of components are indexed as `[componentname]__[paramname]`
            all parameters of `componentname` appear as `paramname` with its value
          * if `deep=True`, also contains arbitrary levels of component recursion,
            e.g., `[componentname]__[componentcomponentname]__[paramname]`, etc
      """
      if not self.is_fitted:
          raise NotFittedError(
              f"estimator of type {type(self).__name__} has not been "
              "fitted yet, please call fit on data before get_fitted_params"
          )
  
      # collect non-nested fitted params of self
      fitted_params = self._get_fitted_params()
  
      # the rest is only for nested parameters
      # so, if deep=False, we simply return here
      if not deep:
          return fitted_params
  
      def sh(x):
          """Shorthand to remove all underscores at end of a string."""
          if x.endswith("_"):
              return sh(x[:-1])
          else:
              return x
  
      # add all nested parameters from components that are sktime BaseObject
      c_dict = self._components()
      for c, comp in c_dict.items():
          if isinstance(comp, BaseEstimator) and comp._is_fitted:
              c_f_params = comp.get_fitted_params()
              c_f_params = {
                  f"{sh(c)}__{k}": v for k, v in c_f_params.items()
              }
              fitted_params.update(c_f_params)
  
      # add all nested parameters from components that are sklearn estimators
      # we do this recursively as we have to reach into nested sklearn estimators
      n_new_params = 42
      old_new_params = fitted_params
      while n_new_params > 0:
          new_params = dict()
          for c, comp in old_new_params.items():
              if isinstance(comp, _BaseEstimator):
                  c_f_params = self._get_fitted_params_default(comp)
                  c_f_params = {
                      f"{sh(c)}__{k}": v for k, v in c_f_params.items()
                  }
                  new_params.update(c_f_params)
          fitted_params.update(new_params)
          old_new_params = new_params.copy()
          n_new_params = len(new_params)
  
      return fitted_params
  
imports: import warnings
  from copy import deepcopy
  from skbase.base import BaseObject
  from sklearn import clone
  from sklearn.base import BaseEstimator
  from sktime.exceptions import NotFittedError
  from sktime.utils.random_state import set_random_state
label_desc: Use image node_id 4 for calling the BaseEstimator obj's underlying member method code with example usage: obj.get_fitted_params(deep) and returns: fitted_params, fitted_params, sh, x