与How to list all scikit-learn classifiers that support predict_proba()类似,我想检索scikit-learn中当前支持的所有分类/回归/聚类算法的列表。
答案 0 :(得分:6)
合并How to list all scikit-learn classifiers that support predict_proba()和http://scikit-learn.org/stable/modules/classes.html#module-sklearn.base会产生解决方案:
from sklearn.utils.testing import all_estimators
from sklearn import base
estimators = all_estimators()
for name, class_ in estimators:
if issubclass(class_, base.ClassifierMixin):
print(name)
或使用任何其他基类:ClusterMixin,RegressorMixin,TransformerMixin。
答案 1 :(得分:1)
这是最新的解决方案:
from sklearn.utils import all_estimators
estimators = all_estimators(type_filter='regressor')
all_regs = []
for name, RegressorClass in estimators:
print('Appending', name)
reg = RegressorClass()
all_regs.append(reg)