def is_classifier(estimator):
    """
    Returns True if the given estimator is (probably) a classifier.
    From: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L526
    """
    return getattr(estimator, "_estimator_type", None) == "classifier"