docstr: Fit the model to data.
  Fit a separate model for each output variable.
  
  Parameters
  ----------
  X : (sparse) array-like, shape (n_samples, n_features)
      Data.
  
  y : (sparse) array-like, shape (n_samples, n_outputs)
      Multi-output targets. An indicator matrix turns on multilabel
      estimation.
  
  sample_weight : array-like, shape = (n_samples) or None
      Sample weights. If None, then samples are equally weighted.
      Only supported if the underlying regressor supports sample
      weights.
  
  Returns
  -------
  self : object
      Returns self.
docstr_tok: ["Fit","the","model","to","data",".","Fit","a","separate","model","for","each","output","variable",".","Parameters","--","--","--","--","--","X",":","(","sparse",")","array-like",",","shape","(","n_samples",",","n_features",")","Data",".","y",":","(","sparse",")","array-like",",","shape","(","n_samples",",","n_outputs",")","Multi-output","targets",".","An","indicator","matrix","turns","on","multilabel","estimation",".","sample_weight",":","array-like",",","shape","=","(","n_samples",")","or","None","Sample","weights",".","If","None",",","then","samples","are","equally","weighted",".","Only","supported","if","the","underlying","regressor","supports","sample","weights",".","Returns","--","--","--","-","self",":","object","Returns","self","."]
code: def fit(self, X, y, sample_weight=None):
      """Fit the model to data.
      Fit a separate model for each output variable.
  
      Parameters
      ----------
      X : (sparse) array-like, shape (n_samples, n_features)
          Data.
  
      y : (sparse) array-like, shape (n_samples, n_outputs)
          Multi-output targets. An indicator matrix turns on multilabel
          estimation.
  
      sample_weight : array-like, shape = (n_samples) or None
          Sample weights. If None, then samples are equally weighted.
          Only supported if the underlying regressor supports sample
          weights.
  
      Returns
      -------
      self : object
          Returns self.
      """
  
      if not hasattr(self.estimator, "fit"):
          raise ValueError(
              "The base estimator should implement a fit method"
          )
  
      X, y = check_X_y(X, y, multi_output=True, accept_sparse=True)
  
      if y.ndim == 1:
          raise ValueError(
              "y must have at least two dimensions for "
              "multi target regression but has only one."
          )
  
      if sample_weight is not None and not has_fit_parameter(
          self.estimator, "sample_weight"
      ):
          raise ValueError(
              "Underlying regressor does not support" " sample weights."
          )
  
      self.estimators_ = Parallel(n_jobs=self.n_jobs)(
          delayed(_fit_estimator)(
              self.estimator, X, y[:, i], sample_weight
          )
          for i in range(y.shape[1])
      )
      return self
  
imports: import numpy
  from abc import ABCMeta
  from .base import BaseEstimator, clone
  from .base import RegressorMixin, ClassifierMixin
  from .utils import check_array, check_X_y
  from .utils.fixes import parallel_helper
  from .utils.validation import check_is_fitted, has_fit_parameter
  from .externals.joblib import Parallel, delayed
  from .externals import six
label_desc: Use image node_id 2 for calling the MultiOutputEstimator obj's underlying member method code with example usage: obj.fit(X, y, sample_weight) and returns: self