is_clusterer#

sklearn.base.is_clusterer(estimator)[source]#

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

Added in version 1.6.

Parameters:
estimatorobject

Estimator object to test.

Returns:
outbool

True if estimator is a clusterer and False otherwise.

Examples

>>>fromsklearn.baseimportis_clusterer>>>fromsklearn.clusterimportKMeans>>>fromsklearn.svmimportSVC,SVR>>>classifier=SVC()>>>regressor=SVR()>>>kmeans=KMeans()>>>is_clusterer(classifier)False>>>is_clusterer(regressor)False>>>is_clusterer(kmeans)True
On this page

This Page