8000 DOC adding suggested spaces in multioutput/RegressorChain (#17498) · scikit-learn/scikit-learn@5a85627 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a85627

Browse files
DOC adding suggested spaces in multioutput/RegressorChain (#17498)
* example for multioutput regressor * add spaces (suggested changes) #DataUmbrella Co-authored-by: Tim Nonner <tim.nonner@tamedia.ch>
1 parent 23c48bf commit 5a85627

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sklearn/multioutput.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,18 @@ class RegressorChain(MetaEstimatorMixin, RegressorMixin, _BaseChain):
756756
order_ : list
757757
The order of labels in the classifier chain.
758758
759+
Examples
760+
--------
761+
>>> from sklearn.multioutput import RegressorChain
762+
>>> from sklearn.linear_model import LogisticRegression
763+
>>> logreg = LogisticRegression(solver='lbfgs',multi_class='multinomial')
764+
>>> X, Y = [[1, 0], [0, 1], [1, 1]], [[0, 2], [1, 1], [2, 0]]
765+
>>> chain = RegressorChain(base_estimator=logreg, order=[0, 1]).fit(X, Y)
766+
>>> chain.predict(X)
767+
array([[0., 2.],
768+
[1., 1.],
769+
[2., 0.]])
770+
759771
See also
760772
--------
761773
ClassifierChain: Equivalent for classification

0 commit comments

Comments
 (0)
0