我在使用sklearn的’predict_proba()’函数来预测Adaboost分类器中每个估计器对样本属于某一类别的概率。
from sklearn.ensemble import AdaBoostClassifierclf = AdaBoostClassifier(n_estimators=50)for estimator in clf.estimators_: print estimator.predict_proba(X_test)
Adaboost的predict_proba()函数的实现如下:
https://github.com/scikit-learn/scikit-learn/blob/bb39b49/sklearn/ensemble/weight_boosting.py#L733
DecisionTreeClassifier是sklearn中Adaboost分类器的基础估计器。DecisionTreeClassifier的predict_proba()函数的实现如下:
https://github.com/scikit-learn/scikit-learn/blob/bb39b49/sklearn/tree/tree.py#L549
请问有人能告诉我Adaboost的predict_proba()函数是如何内部计算概率的吗?有没有关于这个主题的参考资料可以帮助我?请告知我,提前感谢。
回答:
或许Adaboost的“工作原理”部分会有一些帮助?