class sklearn.ensemble.AdaBoostClassifier(base_estimator=None, n_estimators=50, learning_rate=1.0, algorithm=’SAMME.R’, random_state=None)
[source]
An AdaBoost classifier.
An AdaBoost [1] classifier is a meta-estimator that begins by fitting a classifier on the original dataset and then fits additional copies of the classifier on the same dataset but where the weights of incorrectly classified instances are adjusted such that subsequent classifiers focus more on difficult cases.
This class implements the algorithm known as AdaBoost-SAMME [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] |
|
decision_function (X) | Compute the decision function of X . |
fit (X, y[, sample_weight]) | Build a boosted classifier from the training set (X, y). |
get_params ([deep]) | Get parameters for this estimator. |
predict (X) | Predict classes for X. |
predict_log_proba (X) | Predict class log-probabilities for X. |
predict_proba (X) | Predict class probabilities for X. |
score (X, y[, sample_weight]) | Returns the mean accuracy on the given test data and labels. |
set_params (**params) | Set the parameters of this estimator. |
staged_decision_function (X) | Compute decision function of X for each boosting iteration. |
staged_predict (X) | Return staged predictions for X. |
staged_predict_proba (X) | Predict class probabilities 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, algorithm=’SAMME.R’, random_state=None)
[source]
decision_function(X)
[source]
Compute the decision function of X
.
Parameters: |
|
---|---|
Returns: |
|
feature_importances_
Returns: |
|
---|
fit(X, y, sample_weight=None)
[source]
Build a boosted classifier from the training set (X, y).
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
predict(X)
[source]
Predict classes for X.
The predicted class of an input sample is computed as the weighted mean prediction of the classifiers in the ensemble.
Parameters: |
|
---|---|
Returns: |
|
predict_log_proba(X)
[source]
Predict class log-probabilities for X.
The predicted class log-probabilities of an input sample is computed as the weighted mean predicted class log-probabilities of the classifiers in the ensemble.
Parameters: |
|
---|---|
Returns: |
|
predict_proba(X)
[source]
Predict class probabilities for X.
The predicted class probabilities of an input sample is computed as the weighted mean predicted class probabilities of the classifiers in the ensemble.
Parameters: |
|
---|---|
Returns: |
|
score(X, y, sample_weight=None)
[source]
Returns the mean accuracy on the given test data and labels.
In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.
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_decision_function(X)
[source]
Compute decision function of X
for each boosting iteration.
This method allows monitoring (i.e. determine error on testing set) after each boosting iteration.
Parameters: |
|
---|---|
Returns: |
|
staged_predict(X)
[source]
Return staged predictions for X.
The predicted class of an input sample is computed as the weighted mean 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_predict_proba(X)
[source]
Predict class probabilities for X.
The predicted class probabilities of an input sample is computed as the weighted mean predicted class probabilities of the classifiers in the ensemble.
This generator method yields the ensemble predicted class probabilities after each iteration of boosting and therefore allows monitoring, such as to determine the predicted class probabilities 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.AdaBoostClassifier
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.AdaBoostClassifier.html