class_docstr: Mixin adapter class for tslearn models.
docstr: Predict the closest cluster each sample in X belongs to.
  
  Parameters
  ----------
  X : np.ndarray (2d or 3d array of shape (n_instances, series_length) or shape
      (n_instances, n_dimensions, series_length))
      Time series instances to predict their cluster indexes.
  y: ignored, exists for API consistency reasons.
  
  Returns
  -------
  np.ndarray (1d array of shape (n_instances,))
      Index of the cluster each time series in X belongs to.
docstr_tok: ["Predict","the","closest","cluster","each","sample","in","X","belongs","to",".","Parameters","--","--","--","--","--","X",":","np.ndarray","(","2d","or","3d","array","of","shape","(","n_instances",",","series_length",")","or","shape","(","n_instances",",","n_dimensions",",","series_length",")",")","Time","series","instances","to","predict","their","cluster","indexes",".","y",":","ignored",",","exists","for","API","consistency","reasons",".","Returns","--","--","--","-","np.ndarray","(","1d","array","of","shape","(","n_instances",",",")",")","Index","of","the","cluster","each","time","series","in","X","belongs","to","."]
code: def _predict(self, X, y=None):
      """Predict the closest cluster each sample in X belongs to.
  
      Parameters
      ----------
      X : np.ndarray (2d or 3d array of shape (n_instances, series_length) or shape
          (n_instances, n_dimensions, series_length))
          Time series instances to predict their cluster indexes.
      y: ignored, exists for API consistency reasons.
  
      Returns
      -------
      np.ndarray (1d array of shape (n_instances,))
          Index of the cluster each time series in X belongs to.
      """
      tslearn_est = getattr(self, self._estimator_attr)
  
      # check if tslearn_est fit has y parameter
      # if yes, call with y, otherwise without
      tslearn_has_y = "y" in signature(tslearn_est.predict).parameters
  
      if tslearn_has_y:
          return tslearn_est.predict(X, y)
      else:
          return tslearn_est.predict(X)
  
imports: from inspect import signature
label_desc: Use image node_id 5 for calling the _TslearnAdapter obj's underlying member method code with example usage: obj._predict(X, y) and returns: tslearn_est, tslearn_est