class_docstr: CP tensor regression
  
      Learns a low rank CP tensor weight
  
  Parameters
  ----------
  weight_rank : int
      rank of the CP decomposition of the regression weights
  tol : float
      convergence value
  reg_W : int, optional, default is 1
      regularisation on the weights
  n_iter_max : int, optional, default is 100
      maximum number of iteration
  random_state : None, int or RandomState, optional, default is None
  verbose : int, default is 1
      level of verbosity
class_docstr_tok: ["CP","tensor","regression","Learns","a","low","rank","CP","tensor","weight","Parameters","--","--","--","--","--","weight_rank",":","int","rank","of","the","CP","decomposition","of","the","regression","weights","tol",":","float","convergence","value","reg_W",":","int",",","optional",",","default","is","1","regularisation","on","the","weights","n_iter_max",":","int",",","optional",",","default","is","100","maximum","number","of","iteration","random_state",":","None",",","int","or","RandomState",",","optional",",","default","is","None","verbose",":","int",",","default","is","1","level","of","verbosity"]
docstr: Returns the predicted labels for a new data tensor
  
  Parameters
  ----------
  X : ndarray
      tensor data of shape (n_samples, N1, ..., NS)
docstr_tok: ["Returns","the","predicted","labels","for","a","new","data","tensor","Parameters","--","--","--","--","--","X",":","ndarray","tensor","data","of","shape","(","n_samples",",","N1",",","...",",","NS",")"]
code: def predict(self, X):
      """Returns the predicted labels for a new data tensor
  
      Parameters
      ----------
      X : ndarray
          tensor data of shape (n_samples, N1, ..., NS)
      """
      return T.dot(partial_tensor_to_vec(X), self.vec_W_)
  
file_path: tensorly/tensorly/regression/cp_regression.py
imports: import numpy
  from ..base import partial_tensor_to_vec, partial_unfold
  from ..tenalg import khatri_rao
  from ..cp_tensor import cp_to_tensor, cp_to_vec
  from ..None import backend
label_desc: Use image node_id 5 for calling the CPRegressor obj's underlying member method code with example usage: obj.predict(X) and returns: T