def is_classifier(estimator):
    return getattr(estimator, "_estimator_type", None) == "classifier"
Returns True if the given estimator is (probably) a classifier.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/base.py/is_classifier