8000 DOC add example to IsotonicRegression class (#13768) · scikit-learn/scikit-learn@28728f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28728f5

Browse files
veerlosarjnothman
authored andcommitted
DOC add example to IsotonicRegression class (#13768)
1 parent f84a5fe commit 28728f5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sklearn/isotonic.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ class IsotonicRegression(BaseEstimator, TransformerMixin, RegressorMixin):
209209
210210
Correctness of Kruskal's algorithms for monotone regression with ties
211211
Leeuw, Psychometrica, 1977
212+
213+
Examples
214+
--------
215+
>>> from sklearn.datasets import make_regression
216+
>>> from sklearn.isotonic import IsotonicRegression
217+
>>> X, y = make_regression(n_samples=10, n_features=1, random_state=41)
218+
>>> iso_reg = IsotonicRegression().fit(X.flatten(), y)
219+
>>> iso_reg.predict([.1, .2]) # doctest: +ELLIPSIS
220+
array([1.8628..., 3.7256...])
212221
"""
213222
def __init__(self, y_min=None, y_max=None, increasing=True,
214223
out_of_bounds='nan'):

0 commit comments

Comments
 (0)
0