class sklearn.calibration.CalibratedClassifierCV(base_estimator=None, method=’sigmoid’, cv=’warn’)
[source]
Probability calibration with isotonic regression or sigmoid.
With this class, the base_estimator is fit on the train set of the cross-validation generator and the test set is used for calibration. The probabilities for each of the folds are then averaged for prediction. In case that cv=”prefit” is passed to __init__, it is assumed that base_estimator has been fitted already and all data is used for calibration. Note that data for fitting the classifier and for calibrating it must be disjoint.
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
[1] | Obtaining calibrated probability estimates from decision trees and naive Bayesian classifiers, B. Zadrozny & C. Elkan, ICML 2001 |
[2] | Transforming Classifier Scores into Accurate Multiclass Probability Estimates, B. Zadrozny & C. Elkan, (KDD 2002) |
[3] | Probabilistic Outputs for Support Vector Machines and Comparisons to Regularized Likelihood Methods, J. Platt, (1999) |
[4] | Predicting Good Probabilities with Supervised Learning, A. Niculescu-Mizil & R. Caruana, ICML 2005 |
fit (X, y[, sample_weight]) | Fit the calibrated model |
get_params ([deep]) | Get parameters for this estimator. |
predict (X) | Predict the target of new samples. |
predict_proba (X) | Posterior probabilities of classification |
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. |
__init__(base_estimator=None, method=’sigmoid’, cv=’warn’)
[source]
fit(X, y, sample_weight=None)
[source]
Fit the calibrated model
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
predict(X)
[source]
Predict the target of new samples. Can be different from the prediction of the uncalibrated classifier.
Parameters: |
|
---|---|
Returns: |
|
predict_proba(X)
[source]
Posterior probabilities of classification
This function returns posterior probabilities of classification according to each class on an array of test vectors X.
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: |
|
---|
sklearn.calibration.CalibratedClassifierCV
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.calibration.CalibratedClassifierCV.html