2015-05-05 43 views

回答

17
from sklearn.utils.testing import all_estimators 

estimators = all_estimators() 

for name, class_ in estimators: 
    if hasattr(class_, 'predict_proba'): 
     print(name) 

您還可以使用CalibratedClassifierCV作任何分類成一個有predict_proba

這是之前被問過的,但我找不到它,所以你應該原諒它的重複;)

+0

謝謝!我只是昨天閱讀了關於CalibratedClassifierCV的內容,我很想嘗試一下。 – Toby

+0

哦,幾個月後,我偶然發現了什麼可能是你想到的重複:http://stackoverflow.com/questions/22737053/which-estimators-in-scikit-learn-dont-support-sparse-matrices – Toby

+0

這在0.19版本上不可用。該文檔仍然指向它http://scikit-learn.org/stable/developers/utilities.html#testing-functions但測試功能不起作用。是否有任何其他方式知道所有估計器是否支持一種方法(作爲原始問題)? – iblasi

相關問題