Skip to content

Base function to check if the model is a clusterer (analogous to base.is_classifier() and base.is_regressor())? #28904

Answered by ChVeen
aoot asked this question in Q&A
Discussion options

You must be logged in to vote

If one employs git grep to browse the repository, one finds a lot for is_classifier:

$ git grep -E "( |\.)is_classifier"
doc/developers/develop.rst:like :func:`base.is_classifier` should be used.
doc/glossary.rst:                checked by way of a helper such as :func:`base.is_classifier`.
doc/glossary.rst:        :func:`~base.is_classifier`.
doc/glossary.rst:          is a classifier (determined by :func:`base.is_classifier`) and the
doc/modules/classes.rst:   base.is_classifier
sklearn/base.py:def is_classifier(estimator):
...

but nothing for is_clusterer:

$ git grep -E "( |\.)is_clusterer"

There is no corresponding function for clusterer.
I'm afraid, you need to add your own function …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aoot
Comment options

Answer selected by aoot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants