class_docstr: Mixin adapter class for tslearn models.
docstr: Fit estimator training data.
  
  Parameters
  ----------
  X : 3D np.ndarray of shape (n_instances, n_dimensions, series_length)
      Training time series instances to cluster
  y: None or 1D np.ndarray of shape (n_instances,)
      Training labels, passed only for classifiers or regressors
  
  Returns
  -------
  self: sktime estimator
      Fitted estimator.
docstr_tok: ["Fit","estimator","training","data",".","Parameters","--","--","--","--","--","X",":","3D","np.ndarray","of","shape","(","n_instances",",","n_dimensions",",","series_length",")","Training","time","series","instances","to","cluster","y",":","None","or","1D","np.ndarray","of","shape","(","n_instances",",",")","Training","labels",",","passed","only","for","classifiers","or","regressors","Returns","--","--","--","-","self",":","sktime","estimator","Fitted","estimator","."]
code: def _fit(self, X, y=None):
      """Fit estimator training data.
  
      Parameters
      ----------
      X : 3D np.ndarray of shape (n_instances, n_dimensions, series_length)
          Training time series instances to cluster
      y: None or 1D np.ndarray of shape (n_instances,)
          Training labels, passed only for classifiers or regressors
  
      Returns
      -------
      self: sktime estimator
          Fitted estimator.
      """
      tslearn_est = self._init_tslearn_object()
  
      # check if tslearn_est fit has y parameter
      # if yes, call with y, otherwise without
      tslearn_has_y = "y" in signature(tslearn_est.fit).parameters
  
      if tslearn_has_y:
          tslearn_est.fit(X, y)
      else:
          tslearn_est.fit(X)
  
      # write fitted params to self
      tslearn_fitted_params = self._get_fitted_params_default(
          tslearn_est
      )
      for k, v in tslearn_fitted_params.items():
          setattr(self, f"{k}_", v)
  
      return self
  
imports: from inspect import signature
label_desc: Use image node_id 4 for calling the _TslearnAdapter obj's underlying member method code with example usage: obj._fit(X, y) and returns: self