list of all classification algorithms

后端 未结 3 1137
南旧
南旧 2020-12-13 21:45

I have a classification problem and I would like to test all the available algorithms to test their performance in tackling the problem. If you know any classification algo

3条回答
  •  既然无缘
    2020-12-13 22:13

    Here's a more up-to-date solution:

    from sklearn.utils import all_estimators
    
    estimators = all_estimators(type_filter='classifier')
    
    all_clfs = []
    for name, ClassifierClass in estimators:
        print('Appending', name)
        try:
            clf = ClassifierClass()
            all_clfs.append(clf)
        except Exception as e:
            print('Unable to import', name)
            print(e)
    

    UPDATE The previous code stopped working because some estimators required an estimator as init parameter. Hence I updated the code with a try...except. Here's a colab code with it working.

提交回复
热议问题