This is documentation for an old release of Scikit-learn (version 1.4). Try the latest stable release (version 1.6) or development (unstable) versions.
sklearn.base
.is_regressor¶
- sklearn.base.is_regressor(estimator)[source]¶
Return True if the given estimator is (probably) a regressor.
- Parameters:
- estimatorestimator instance
Estimator object to test.
- Returns:
- outbool
True if estimator is a regressor and False otherwise.
Examples
>>> from sklearn.base import is_regressor >>> from sklearn.svm import SVC, SVR >>> classifier = SVC() >>> regressor = SVR() >>> is_regressor(classifier) False >>> is_regressor(regressor) True