class_docstr: MultiTaskLasso scikit-learn estimator based on Celer solver
  
  The optimization objective for MultiTaskLasso is::
  
  (1 / (2 * n_samples)) * ||y - X W||^2_2 + alpha * ||W||_{21}
  
  Parameters
  ----------
  alpha : float, optional
      Constant that multiplies the L1 term. Defaults to 1.0.
      ``alpha = 0`` is equivalent to an ordinary least square.
      For numerical reasons, using ``alpha = 0`` with the
      ``Lasso`` object is not advised.
  
  max_iter : int, optional
      The maximum number of iterations (subproblem definitions)
  
  max_epochs : int
      Maximum number of CD epochs on each subproblem.
  
  p0 : int
      First working set size.
  
  verbose : bool or integer
      Amount of verbosity.
  
  tol : float, optional
      Stopping criterion for the optimization: the solver runs until the
      duality gap is smaller than ``tol * norm(y) ** 2 / len(y)`` or the
      maximum number of iteration is reached.
  
  prune : bool, optional (default=True)
      Whether or not to use pruning when growing working sets.
  
  fit_intercept : bool, optional (default=True)
      Whether or not to fit an intercept.
  
  warm_start : bool, optional (default=False)
      When set to True, reuse the solution of the previous call to fit as
      initialization, otherwise, just erase the previous solution.
  
  Attributes
  ----------
  coef_ : array, shape (n_features,)
      parameter vector (w in the cost function formula)
  
  sparse_coef_ : scipy.sparse matrix, shape (n_features, 1)
      ``sparse_coef_`` is a readonly property derived from ``coef_``
  
  intercept_ : float
      constant term in decision function.
  
  n_iter_ : int
      Number of subproblems solved by Celer to reach the specified tolerance.
  
  See also
  --------
  celer_path
  MultiTaskLassoCV
  
  References
  ----------
  .. [1] M. Massias, A. Gramfort, J. Salmon
    "Celer: a Fast Solver for the Lasso wit Dual Extrapolation", ICML 2018,
    http://proceedings.mlr.press/v80/massias18a.html
class_docstr_tok: ["MultiTaskLasso","scikit-learn","estimator","based","on","Celer","solver","The","optimization","objective","for","MultiTaskLasso","is",":",":","(","1","\/","(","2","*","n_samples",")",")","*","||y","-","X","W||^2_2","+","alpha","*","||W||_","{","21","}","Parameters","--","--","--","--","--","alpha",":","float",",","optional","Constant","that","multiplies","the","L1","term",".","Defaults","to","1.0",".","``","alpha","=","0","``","is","equivalent","to","an","ordinary","least","square",".","For","numerical","reasons",",","using","``","alpha","=","0","``","with","the","``","Lasso","``","object","is","not","advised",".","max_iter",":","int",",","optional","The","maximum","number","of","iterations","(","subproblem","definitions",")","max_epochs",":","int","Maximum","number","of","CD","epochs","on","each","subproblem",".","p0",":","int","First","working","set","size",".","verbose",":","bool","or","integer","Amount","of","verbosity",".","tol",":","float",",","optional","Stopping","criterion","for","the","optimization",":","the","solver","runs","until","the","duality","gap","is","smaller","than","``","tol","*","norm","(","y",")","*","*","2","\/","len","(","y",")","``","or","the","maximum","number","of","iteration","is","reached",".","prune",":","bool",",","optional","(","default=True",")","Whether","or","not","to","use","pruning","when","growing","working","sets",".","fit_intercept",":","bool",",","optional","(","default=True",")","Whether","or","not","to","fit","an","intercept",".","warm_start",":","bool",",","optional","(","default=False",")","When","set","to","True",",","reuse","the","solution","of","the","previous","call","to","fit","as","initialization",",","otherwise",",","just","erase","the","previous","solution",".","Attributes","--","--","--","--","--","coef_",":","array",",","shape","(","n_features",",",")","parameter","vector","(","w","in","the","cost","function","formula",")","sparse_coef_",":","scipy.sparse","matrix",",","shape","(","n_features",",","1",")","``","sparse_coef_","``","is","a","readonly","property","derived","from","``","coef_","``","intercept_",":","float","constant","term","in","decision","function",".","n_iter_",":","int","Number","of","subproblems","solved","by","Celer","to","reach","the","specified","tolerance",".","See","also","--","--","--","--","celer_path","MultiTaskLassoCV","References","--","--","--","--","--","..","[","1","]","M.","Massias",",","A.","Gramfort",",","J.","Salmon","``","Celer",":","a","Fast","Solver","for","the","Lasso","wit","Dual","Extrapolation","''",",","ICML","2018",",","http",":","\/\/proceedings.mlr.press\/v80\/massias18a.html"]
docstr: Fit MultiTaskLasso model with Celer
code: def fit(self, X, y):
      """Fit MultiTaskLasso model with Celer"""
      # Need to validate separately here.
      # We can't pass multi_ouput=True because that would allow y to be csr.
      check_X_params = dict(
          dtype=[np.float64, np.float32],
          order="F",
          copy=self.copy_X and self.fit_intercept,
      )
      check_y_params = dict(ensure_2d=False, order="F")
      X, y = self._validate_data(
          X, y, validate_separately=(check_X_params, check_y_params)
      )
      y = y.astype(X.dtype)
  
      if y.ndim == 1:
          raise ValueError("For mono-task outputs, use Lasso")
  
      n_samples = X.shape[0]
  
      if n_samples != y.shape[0]:
          raise ValueError(
              "X and y have inconsistent dimensions (%d != %d)"
              % (n_samples, y.shape[0])
          )
  
      X, y, X_offset, y_offset, X_scale = _preprocess_data(
          X, y, self.fit_intercept, copy=False
      )
  
      if not self.warm_start or not hasattr(self, "coef_"):
          self.coef_ = None
  
      _, coefs, dual_gaps = mtl_path(
          X,
          y,
          alphas=[self.alpha],
          coef_init=self.coef_,
          max_iter=self.max_iter,
          max_epochs=self.max_epochs,
          p0=self.p0,
          verbose=self.verbose,
          tol=self.tol,
          prune=self.prune,
      )
  
      self.coef_, self.dual_gap_ = coefs[..., 0], dual_gaps[-1]
      self.n_iter_ = len(dual_gaps)
      self._set_intercept(X_offset, y_offset, X_scale)
  
      return self
  
imports: import numbers
  import numpy
  from sklearn.base import RegressorMixin, MultiOutputMixin
  from sklearn.utils.validation import check_X_y
  from sklearn.utils.multiclass import check_classification_targets
  from sklearn.linear_model import ElasticNet, Lasso, LogisticRegression, MultiTaskLasso
  from sklearn.linear_model._coordinate_descent import LinearModelCV
  from sklearn.linear_model._base import _preprocess_data
  from sklearn.preprocessing import LabelEncoder
  from sklearn.multiclass import OneVsRestClassifier
  from .homotopy import celer_path, mtl_path
label_desc: Use image node_id 2 for calling the MultiTaskLasso obj's underlying member method code with example usage: obj.fit(X, y) and returns: self