class_docstr: A multi-label model that arranges binary classifiers into a chain.
  
  Each model makes a prediction in the order specified by the chain using
  all of the available features provided to the model plus the predictions
  of models that are earlier in the chain.
  
  For an example of how to use ``ClassifierChain`` and benefit from its
  ensemble, see
  :ref:`ClassifierChain on a yeast dataset
  <sphx_glr_auto_examples_multioutput_plot_classifier_chain_yeast.py>` example.
  
  Read more in the :ref:`User Guide <classifierchain>`.
  
  .. versionadded:: 0.19
  
  Parameters
  ----------
  base_estimator : estimator
      The base estimator from which the classifier chain is built.
  
  order : array-like of shape (n_outputs,) or 'random', default=None
      If `None`, the order will be determined by the order of columns in
      the label matrix Y.::
  
          order = [0, 1, 2, ..., Y.shape[1] - 1]
  
      The order of the chain can be explicitly set by providing a list of
      integers. For example, for a chain of length 5.::
  
          order = [1, 3, 2, 4, 0]
  
      means that the first model in the chain will make predictions for
      column 1 in the Y matrix, the second model will make predictions
      for column 3, etc.
  
      If order is `random` a random ordering will be used.
  
  cv : int, cross-validation generator or an iterable, default=None
      Determines whether to use cross validated predictions or true
      labels for the results of previous estimators in the chain.
      Possible inputs for cv are:
  
      - None, to use true labels when fitting,
      - integer, to specify the number of folds in a (Stratified)KFold,
      - :term:`CV splitter`,
      - An iterable yielding (train, test) splits as arrays of indices.
  
  random_state : int, RandomState instance or None, optional (default=None)
      If ``order='random'``, determines random number generation for the
      chain order.
      In addition, it controls the random seed given at each `base_estimator`
      at each chaining iteration. Thus, it is only used when `base_estimator`
      exposes a `random_state`.
      Pass an int for reproducible output across multiple function calls.
      See :term:`Glossary <random_state>`.
  
  verbose : bool, default=False
      If True, chain progress is output as each model is completed.
  
      .. versionadded:: 1.2
  
  Attributes
  ----------
  classes_ : list
      A list of arrays of length ``len(estimators_)`` containing the
      class labels for each estimator in the chain.
  
  estimators_ : list
      A list of clones of base_estimator.
  
  order_ : list
      The order of labels in the classifier chain.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`. Only defined if the
      underlying `base_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`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  RegressorChain : Equivalent for regression.
  MultiOutputClassifier : Classifies each output independently rather than
      chaining.
  
  References
  ----------
  Jesse Read, Bernhard Pfahringer, Geoff Holmes, Eibe Frank, "Classifier
  Chains for Multi-label Classification", 2009.
  
  Examples
  --------
  >>> from sklearn.datasets import make_multilabel_classification
  >>> from sklearn.linear_model import LogisticRegression
  >>> from sklearn.model_selection import train_test_split
  >>> from sklearn.multioutput import ClassifierChain
  >>> X, Y = make_multilabel_classification(
  ...    n_samples=12, n_classes=3, random_state=0
  ... )
  >>> X_train, X_test, Y_train, Y_test = train_test_split(
  ...    X, Y, random_state=0
  ... )
  >>> base_lr = LogisticRegression(solver='lbfgs', random_state=0)
  >>> chain = ClassifierChain(base_lr, order='random', random_state=0)
  >>> chain.fit(X_train, Y_train).predict(X_test)
  array([[1., 1., 0.],
         [1., 0., 0.],
         [0., 1., 0.]])
  >>> chain.predict_proba(X_test)
  array([[0.8387..., 0.9431..., 0.4576...],
         [0.8878..., 0.3684..., 0.2640...],
         [0.0321..., 0.9935..., 0.0625...]])
class_docstr_tok: ["A","multi-label","model","that","arranges","binary","classifiers","into","a","chain",".","Each","model","makes","a","prediction","in","the","order","specified","by","the","chain","using","all","of","the","available","features","provided","to","the","model","plus","the","predictions","of","models","that","are","earlier","in","the","chain",".","For","an","example","of","how","to","use","``","ClassifierChain","``","and","benefit","from","its","ensemble",",","see",":","ref",":","`","ClassifierChain","on","a","yeast","dataset","<","sphx_glr_auto_examples_multioutput_plot_classifier_chain_yeast.py",">","`","example",".","Read","more","in","the",":","ref",":","`","User","Guide","<","classifierchain",">","`",".","..","versionadded",":",":","0.19","Parameters","--","--","--","--","--","base_estimator",":","estimator","The","base","estimator","from","which","the","classifier","chain","is","built",".","order",":","array-like","of","shape","(","n_outputs",",",")","or","'random","'",",","default=None","If","`","None","`",",","the","order","will","be","determined","by","the","order","of","columns","in","the","label","matrix","Y.",":",":","order","=","[","0",",","1",",","2",",","...",",","Y.shape","[","1","]","-","1","]","The","order","of","the","chain","can","be","explicitly","set","by","providing","a","list","of","integers",".","For","example",",","for","a","chain","of","length","5.",":",":","order","=","[","1",",","3",",","2",",","4",",","0","]","means","that","the","first","model","in","the","chain","will","make","predictions","for","column","1","in","the","Y","matrix",",","the","second","model","will","make","predictions","for","column","3",",","etc",".","If","order","is","`","random","`","a","random","ordering","will","be","used",".","cv",":","int",",","cross-validation","generator","or","an","iterable",",","default=None","Determines","whether","to","use","cross","validated","predictions","or","true","labels","for","the","results","of","previous","estimators","in","the","chain",".","Possible","inputs","for","cv","are",":","-","None",",","to","use","true","labels","when","fitting",",","-","integer",",","to","specify","the","number","of","folds","in","a","(","Stratified",")","KFold",",","-",":","term",":","`","CV","splitter","`",",","-","An","iterable","yielding","(","train",",","test",")","splits","as","arrays","of","indices",".","random_state",":","int",",","RandomState","instance","or","None",",","optional","(","default=None",")","If","``","order='random","'","``",",","determines","random","number","generation","for","the","chain","order",".","In","addition",",","it","controls","the","random","seed","given","at","each","`","base_estimator","`","at","each","chaining","iteration",".","Thus",",","it","is","only","used","when","`","base_estimator","`","exposes","a","`","random_state","`",".","Pass","an","int","for","reproducible","output","across","multiple","function","calls",".","See",":","term",":","`","Glossary","<","random_state",">","`",".","verbose",":","bool",",","default=False","If","True",",","chain","progress","is","output","as","each","model","is","completed",".","..","versionadded",":",":","1.2","Attributes","--","--","--","--","--","classes_",":","list","A","list","of","arrays","of","length","``","len","(","estimators_",")","``","containing","the","class","labels","for","each","estimator","in","the","chain",".","estimators_",":","list","A","list","of","clones","of","base_estimator",".","order_",":","list","The","order","of","labels","in","the","classifier","chain",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","Only","defined","if","the","underlying","`","base_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","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","RegressorChain",":","Equivalent","for","regression",".","MultiOutputClassifier",":","Classifies","each","output","independently","rather","than","chaining",".","References","--","--","--","--","--","Jesse","Read",",","Bernhard","Pfahringer",",","Geoff","Holmes",",","Eibe","Frank",",","``","Classifier","Chains","for","Multi-label","Classification","''",",","2009",".","Examples","--","--","--","--",">",">",">","from","sklearn.datasets","import","make_multilabel_classification",">",">",">","from","sklearn.linear_model","import","LogisticRegression",">",">",">","from","sklearn.model_selection","import","train_test_split",">",">",">","from","sklearn.multioutput","import","ClassifierChain",">",">",">","X",",","Y","=","make_multilabel_classification","(","...","n_samples=12",",","n_classes=3",",","random_state=0","...",")",">",">",">","X_train",",","X_test",",","Y_train",",","Y_test","=","train_test_split","(","...","X",",","Y",",","random_state=0","...",")",">",">",">","base_lr","=","LogisticRegression","(","solver='lbfgs","'",",","random_state=0",")",">",">",">","chain","=","ClassifierChain","(","base_lr",",","order='random","'",",","random_state=0",")",">",">",">","chain.fit","(","X_train",",","Y_train",")",".predict","(","X_test",")","array","(","[","[","1.",",","1.",",","0",".","]",",","[","1.",",","0.",",","0",".","]",",","[","0.",",","1.",",","0",".","]","]",")",">",">",">","chain.predict_proba","(","X_test",")","array","(","[","[","0.8387","...",",","0.9431","...",",","0.4576","...","]",",","[","0.8878","...",",","0.3684","...",",","0.2640","...","]",",","[","0.0321","...",",","0.9935","...",",","0.0625","...","]","]",")"]
docstr: Predict probability estimates.
  
  Parameters
  ----------
  X : {array-like, sparse matrix} of shape (n_samples, n_features)
      The input data.
  
  Returns
  -------
  Y_prob : array-like of shape (n_samples, n_classes)
      The predicted probabilities.
code: def predict_proba(self, X):
      """Predict probability estimates.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples, n_features)
          The input data.
  
      Returns
      -------
      Y_prob : array-like of shape (n_samples, n_classes)
          The predicted probabilities.
      """
      X = self._validate_data(X, accept_sparse=True, reset=False)
      Y_prob_chain = np.zeros((X.shape[0], len(self.estimators_)))
      Y_pred_chain = np.zeros((X.shape[0], len(self.estimators_)))
      for chain_idx, estimator in enumerate(self.estimators_):
          previous_predictions = Y_pred_chain[:, :chain_idx]
          if sp.issparse(X):
              X_aug = sp.hstack((X, previous_predictions))
          else:
              X_aug = np.hstack((X, previous_predictions))
          Y_prob_chain[:, chain_idx] = estimator.predict_proba(X_aug)[
              :, 1
          ]
          Y_pred_chain[:, chain_idx] = estimator.predict(X_aug)
      inv_order = np.empty_like(self.order_)
      inv_order[self.order_] = np.arange(len(self.order_))
      Y_prob = Y_prob_chain[:, inv_order]
  
      return Y_prob
  
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 ClassifierChain obj's underlying member method code with example usage: obj.predict_proba(X) and returns: Y_prob