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