A multi-label model that arranges regressions 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.
Read more in the :ref:`User Guide <regressorchain>`.
.. versionadded:: 0.20
Parameters ---------- base_estimator : estimator The base estimator from which the classifier chain is built.
order : array-like of shape (n_outputs,) or 'random', optional By default 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, optional (default=None) Determines whether to use cross validated predictions or true labels for the results of previous estimators in the chain. If cv is None the true labels are used when fitting. Otherwise possible inputs for cv are:
- 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>`.
Attributes ---------- estimators_ : list A list of clones of base_estimator.
order_ : list The order of labels in the classifier chain.
See also -------- ClassifierChain: Equivalent for classification MultioutputRegressor: Learns each output independently rather than chaining.