class_docstr: Multi target classification.
  
  This strategy consists of fitting one classifier per target. This is a
  simple strategy for extending classifiers that do not natively support
  multi-target classification.
  
  Parameters
  ----------
  estimator : estimator object
      An estimator object implementing :term:`fit` and :term:`predict`.
      A :term:`predict_proba` method will be exposed only if `estimator` implements
      it.
  
  n_jobs : int or None, optional (default=None)
      The number of jobs to run in parallel.
      :meth:`fit`, :meth:`predict` and :meth:`partial_fit` (if supported
      by the passed estimator) will be parallelized for each target.
  
      When individual estimators are fast to train or predict,
      using ``n_jobs > 1`` can result in slower performance due
      to the parallelism overhead.
  
      ``None`` means `1` unless in a :obj:`joblib.parallel_backend` context.
      ``-1`` means using all available processes / threads.
      See :term:`Glossary <n_jobs>` for more details.
  
      .. versionchanged:: 0.20
          `n_jobs` default changed from `1` to `None`.
  
  Attributes
  ----------
  classes_ : ndarray of shape (n_classes,)
      Class labels.
  
  estimators_ : list of ``n_output`` estimators
      Estimators used for predictions.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`. Only defined if the
      underlying `estimator` exposes such an attribute when fit.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Only defined if the
      underlying estimators expose such an attribute when fit.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  ClassifierChain : A multi-label model that arranges binary classifiers
      into a chain.
  MultiOutputRegressor : Fits one regressor per target variable.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.datasets import make_multilabel_classification
  >>> from sklearn.multioutput import MultiOutputClassifier
  >>> from sklearn.linear_model import LogisticRegression
  >>> X, y = make_multilabel_classification(n_classes=3, random_state=0)
  >>> clf = MultiOutputClassifier(LogisticRegression()).fit(X, y)
  >>> clf.predict(X[-2:])
  array([[1, 1, 1],
         [1, 0, 1]])
class_docstr_tok: ["Multi","target","classification",".","This","strategy","consists","of","fitting","one","classifier","per","target",".","This","is","a","simple","strategy","for","extending","classifiers","that","do","not","natively","support","multi-target","classification",".","Parameters","--","--","--","--","--","estimator",":","estimator","object","An","estimator","object","implementing",":","term",":","`","fit","`","and",":","term",":","`","predict","`",".","A",":","term",":","`","predict_proba","`","method","will","be","exposed","only","if","`","estimator","`","implements","it",".","n_jobs",":","int","or","None",",","optional","(","default=None",")","The","number","of","jobs","to","run","in","parallel",".",":","meth",":","`","fit","`",",",":","meth",":","`","predict","`","and",":","meth",":","`","partial_fit","`","(","if","supported","by","the","passed","estimator",")","will","be","parallelized","for","each","target",".","When","individual","estimators","are","fast","to","train","or","predict",",","using","``","n_jobs",">","1","``","can","result","in","slower","performance","due","to","the","parallelism","overhead",".","``","None","``","means","`","1","`","unless","in","a",":","obj",":","`","joblib.parallel_backend","`","context",".","``","-1","``","means","using","all","available","processes","\/","threads",".","See",":","term",":","`","Glossary","<","n_jobs",">","`","for","more","details",".","..","versionchanged",":",":","0.20","`","n_jobs","`","default","changed","from","`","1","`","to","`","None","`",".","Attributes","--","--","--","--","--","classes_",":","ndarray","of","shape","(","n_classes",",",")","Class","labels",".","estimators_",":","list","of","``","n_output","``","estimators","Estimators","used","for","predictions",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","Only","defined","if","the","underlying","`","estimator","`","exposes","such","an","attribute","when","fit",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Only","defined","if","the","underlying","estimators","expose","such","an","attribute","when","fit",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","ClassifierChain",":","A","multi-label","model","that","arranges","binary","classifiers","into","a","chain",".","MultiOutputRegressor",":","Fits","one","regressor","per","target","variable",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.datasets","import","make_multilabel_classification",">",">",">","from","sklearn.multioutput","import","MultiOutputClassifier",">",">",">","from","sklearn.linear_model","import","LogisticRegression",">",">",">","X",",","y","=","make_multilabel_classification","(","n_classes=3",",","random_state=0",")",">",">",">","clf","=","MultiOutputClassifier","(","LogisticRegression","(",")",")",".fit","(","X",",","y",")",">",">",">","clf.predict","(","X","[","-2",":","]",")","array","(","[","[","1",",","1",",","1","]",",","[","1",",","0",",","1","]","]",")"]
docstr: Fit the model to data matrix X and targets Y.
  
  Parameters
  ----------
  X : {array-like, sparse matrix} of shape (n_samples, n_features)
      The input data.
  
  Y : array-like of shape (n_samples, n_classes)
      The target values.
  
  sample_weight : array-like of shape (n_samples,), default=None
      Sample weights. If `None`, then samples are equally weighted.
      Only supported if the underlying classifier supports sample
      weights.
  
  **fit_params : dict of string -> object
      Parameters passed to the ``estimator.fit`` method of each step.
  
      .. versionadded:: 0.23
  
  Returns
  -------
  self : object
      Returns a fitted instance.
code: def fit(self, X, Y, sample_weight=None, **fit_params):
      """Fit the model to data matrix X and targets Y.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples, n_features)
          The input data.
  
      Y : array-like of shape (n_samples, n_classes)
          The target values.
  
      sample_weight : array-like of shape (n_samples,), default=None
          Sample weights. If `None`, then samples are equally weighted.
          Only supported if the underlying classifier supports sample
          weights.
  
      **fit_params : dict of string -> object
          Parameters passed to the ``estimator.fit`` method of each step.
  
          .. versionadded:: 0.23
  
      Returns
      -------
      self : object
          Returns a fitted instance.
      """
      super().fit(X, Y, sample_weight=sample_weight, **fit_params)
      self.classes_ = [
          estimator.classes_ for estimator in self.estimators_
      ]
      return self
  
imports: from abc import ABCMeta, abstractmethod
  from numbers import Integral
  import numpy
  import scipy.sparse
  from .base import BaseEstimator, ClassifierMixin, MetaEstimatorMixin, RegressorMixin, _fit_context, clone, is_classifier
  from .model_selection import cross_val_predict
  from .utils import Bunch, _print_elapsed_time, check_random_state
  from .utils._param_validation import HasMethods, StrOptions
  from .utils.metadata_routing import MetadataRouter, MethodMapping, _routing_enabled, process_routing
  from .utils.metaestimators import available_if
  from .utils.multiclass import check_classification_targets
  from .utils.parallel import Parallel, delayed
  from .utils.validation import _check_fit_params, check_is_fitted, has_fit_parameter
label_desc: Use image node_id 2 for calling the MultiOutputClassifier obj's underlying member method code with example usage: obj.fit(X, Y, sample_weight) and returns: self