sklearn.base.is_classifier

sklearn.base.is_classifier(estimator)[source]

Return True if the given estimator is (probably) a classifier.

Parameters:
estimatorobject

Estimator object to test.

Returns:
outbool

True if estimator is a classifier and False otherwise.

Examples

>>> from sklearn.base import is_classifier
>>> from sklearn.svm import SVC, SVR
>>> classifier = SVC()
>>> regressor = SVR()
>>> is_classifier(classifier)
True
>>> is_classifier(regressor)
False