Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all classification/regression/clustering algorithms in scikit-learn?

In analogy to How to list all scikit-learn classifiers that support predict_proba() I want to retrieve a list of all classification/regression/clustering algorithms currently supported in scikit-learn.

like image 634
DreamFlasher Avatar asked Feb 10 '17 13:02

DreamFlasher


People also ask

How many algorithms are there in scikit-learn?

Finally we will use three different algorithms (Naive-Bayes, LinearSVC, K-Neighbors Classifier) to make predictions and compare their performance using methods like accuracy_score() provided by the scikit-learn library.

Which Python library features classification regression and clustering algorithm?

Scikit-learn is the most popular Python library for performing classification, regression, and clustering algorithms. It is an essential part of other Python data science libraries like matplotlib , NumPy (for graphs and visualization), and SciPy (for mathematics).

What are the regression models in sklearn?

Three types of Machine Learning Models can be implemented using the Sklearn Regression Models: Reinforced Learning. Unsupervised Learning. Supervised Learning.

How do you identify regression classification?

In Regression, the output is a continuous or numerical value. In Classification, the output is a discrete or categorical value. Regression model maps the input variable(x) with the continuous output variable(y). Classification model maps the input variable(x) with the discrete output variable(y).


1 Answers

Combining How to list all scikit-learn classifiers that support predict_proba() and http://scikit-learn.org/stable/modules/classes.html#module-sklearn.base yields the solution:

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)

Or use any other base class: ClusterMixin, RegressorMixin, TransformerMixin.

like image 157
DreamFlasher Avatar answered Sep 25 '22 16:09

DreamFlasher