MCPcopy
hub / github.com/scikit-learn/scikit-learn / is_classifier

Function is_classifier

sklearn/base.py:1245–1273  ·  view source on GitHub ↗

Return True if the given estimator is (probably) a classifier. Parameters ---------- estimator : estimator instance Estimator object to test. Returns ------- out : bool True if estimator is a classifier and False otherwise. Examples -------- >>>

(estimator)

Source from the content-addressed store, hash-verified

1243
1244
1245def is_classifier(estimator):
1246 """Return True if the given estimator is (probably) a classifier.
1247
1248 Parameters
1249 ----------
1250 estimator : estimator instance
1251 Estimator object to test.
1252
1253 Returns
1254 -------
1255 out : bool
1256 True if estimator is a classifier and False otherwise.
1257
1258 Examples
1259 --------
1260 >>> from sklearn.base import is_classifier
1261 >>> from sklearn.cluster import KMeans
1262 >>> from sklearn.svm import SVC, SVR
1263 >>> classifier = SVC()
1264 >>> regressor = SVR()
1265 >>> kmeans = KMeans()
1266 >>> is_classifier(classifier)
1267 True
1268 >>> is_classifier(regressor)
1269 False
1270 >>> is_classifier(kmeans)
1271 False
1272 """
1273 return get_tags(estimator).estimator_type == "classifier"
1274
1275
1276def is_regressor(estimator):

Callers 15

fitMethod · 0.90
cross_validateFunction · 0.90
cross_val_predictFunction · 0.90
permutation_test_scoreFunction · 0.90
learning_curveFunction · 0.90
validation_curveFunction · 0.90
fitMethod · 0.90
_fitMethod · 0.90

Calls 1

get_tagsFunction · 0.90

Used in the wild real call sites across dependent graphs

searching dependent graphs…