class sklearn.isotonic.IsotonicRegression(y_min=None, y_max=None, increasing=True, out_of_bounds=’nan’)
[source]
Isotonic regression model.
The isotonic regression optimization problem is defined by:
min sum w_i (y[i] - y_[i]) ** 2 subject to y_[i] <= y_[j] whenever X[i] <= X[j] and min(y_) = y_min, max(y_) = y_max
y[i]
are inputs (real numbers)y_[i]
are fittedX
specifies the order. If X
is non-decreasing then y_
is non-decreasing.w[i]
are optional strictly positive weights (default to 1.0)Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
Ties are broken using the secondary method from Leeuw, 1977.
Isotonic Median Regression: A Linear Programming Approach Nilotpal Chakravarti Mathematics of Operations Research Vol. 14, No. 2 (May, 1989), pp. 303-308
Isotone Optimization in R : Pool-Adjacent-Violators Algorithm (PAVA) and Active Set Methods Leeuw, Hornik, Mair Journal of Statistical Software 2009
Correctness of Kruskal’s algorithms for monotone regression with ties Leeuw, Psychometrica, 1977
fit (X, y[, sample_weight]) | Fit the model using X, y as training data. |
fit_transform (X[, y]) | Fit to data, then transform it. |
get_params ([deep]) | Get parameters for this estimator. |
predict (T) | Predict new data by linear interpolation. |
score (X, y[, sample_weight]) | Returns the coefficient of determination R^2 of the prediction. |
set_params (**params) | Set the parameters of this estimator. |
transform (T) | Transform new data by linear interpolation |
__init__(y_min=None, y_max=None, increasing=True, out_of_bounds=’nan’)
[source]
fit(X, y, sample_weight=None)
[source]
Fit the model using X, y as training data.
Parameters: |
|
---|---|
Returns: |
|
X is stored for future use, as transform
needs X to interpolate new input data.
fit_transform(X, y=None, **fit_params)
[source]
Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
predict(T)
[source]
Predict new data by linear interpolation.
Parameters: |
|
---|---|
Returns: |
|
score(X, y, sample_weight=None)
[source]
Returns the coefficient of determination R^2 of the prediction.
The coefficient R^2 is defined as (1 - u/v), where u is the residual sum of squares ((y_true - y_pred) ** 2).sum() and v is the total sum of squares ((y_true - y_true.mean()) ** 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a R^2 score of 0.0.
Parameters: |
|
---|---|
Returns: |
|
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: |
|
---|
transform(T)
[source]
Transform new data by linear interpolation
Parameters: |
|
---|---|
Returns: |
|
sklearn.isotonic.IsotonicRegression
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.isotonic.IsotonicRegression.html