Return True if the given estimator is (probably) a classifier.
Estimator object to test.
True if estimator is a classifier and False otherwise.
>>> from sklearn.base import is_classifier >>> from sklearn.cluster import KMeans >>> from sklearn.svm import SVC, SVR >>> classifier = SVC() >>> regressor = SVR() >>> kmeans = KMeans() >>> is_classifier(classifier) True >>> is_classifier(regressor) False >>> is_classifier(kmeans) False
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.base.is_classifier.html