class sklearn.ensemble.AdaBoostRegressor(base_estimator=None, n_estimators=50, learning_rate=1.0, loss=’linear’, random_state=None)
[source]
An AdaBoost regressor.
An AdaBoost [1] regressor is a meta-estimator that begins by fitting a regressor on the original dataset and then fits additional copies of the regressor on the same dataset but where the weights of instances are adjusted according to the error of the current prediction. As such, subsequent regressors focus more on difficult cases.
This class implements the algorithm known as AdaBoost.R2 [2].
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
[1] | Y. Freund, R. Schapire, “A Decision-Theoretic Generalization of on-Line Learning and an Application to Boosting”, 1995. |
[2] |
|
fit (X, y[, sample_weight]) | Build a boosted regressor from the training set (X, y). |
get_params ([deep]) | Get parameters for this estimator. |
predict (X) | Predict regression value for X. |
score (X, y[, sample_weight]) | Returns the coefficient of determination R^2 of the prediction. |
set_params (**params) | Set the parameters of this estimator. |
staged_predict (X) | Return staged predictions for X. |
staged_score (X, y[, sample_weight]) | Return staged scores for X, y. |
__init__(base_estimator=None, n_estimators=50, learning_rate=1.0, loss=’linear’, random_state=None)
[source]
feature_importances_
Returns: |
|
---|
fit(X, y, sample_weight=None)
[source]
Build a boosted regressor from the training set (X, y).
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
predict(X)
[source]
Predict regression value for X.
The predicted regression value of an input sample is computed as the weighted median prediction of the classifiers in the ensemble.
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: |
|
---|
staged_predict(X)
[source]
Return staged predictions for X.
The predicted regression value of an input sample is computed as the weighted median prediction of the classifiers in the ensemble.
This generator method yields the ensemble prediction after each iteration of boosting and therefore allows monitoring, such as to determine the prediction on a test set after each boost.
Parameters: |
|
---|---|
Returns: |
|
staged_score(X, y, sample_weight=None)
[source]
Return staged scores for X, y.
This generator method yields the ensemble score after each iteration of boosting and therefore allows monitoring, such as to determine the score on a test set after each boost.
Parameters: |
|
---|---|
Returns: |
|
sklearn.ensemble.AdaBoostRegressor
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.AdaBoostRegressor.html