list of all classification algorithms

后端 未结 3 1136
南旧
南旧 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:04

    You may want to look at the following question:

    How to list all scikit-learn classifiers that support predict_proba()

    The accepted answer shows the method to get all estimators in scikit which support predict_probas method. Just iterate and print all names without checking the condition and you get all estimators. (Classifiers, regressors, cluster etc)

    For only classifiers, modify it like below to check all classes that implement ClassifierMixin

    from sklearn.base import ClassifierMixin
    from sklearn.utils.testing import all_estimators
    classifiers=[est for est in all_estimators() if issubclass(est[1], ClassifierMixin)]
    print(classifiers)
    

    For versions >= 0.22, use this:

    from sklearn.utils import all_estimators
    

    instead of sklearn.utils.testing

    Points to note:

    • The classifiers with CV suffixed to their names implement inbuilt cross-validation (like LogisticRegressionCV, RidgeClassifierCV etc).
    • Some are ensemble and may take other classifiers in input arguments.
    • Some classifiers like _QDA, _LDA are aliases for other classifiers and may be removed in next versions of scikit-learn.

    You should check their respective reference docs before using them

提交回复
热议问题