From bf103ea981e0a736d629bc13a333e73db23d914d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Sat, 28 Sep 2024 14:40:11 +0200 Subject: [PATCH 1/3] After pre-commit --- doc/developers/develop.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst index 92f35b1346926..a4792fc6c4578 100644 --- a/doc/developers/develop.rst +++ b/doc/developers/develop.rst @@ -475,9 +475,16 @@ on a classifier, but not otherwise. Similarly, scorers for average precision that take a continuous prediction need to call ``decision_function`` for classifiers, but ``predict`` for regressors. This distinction between classifiers and regressors is implemented using the ``_estimator_type`` attribute, which takes a string value. -It should be ``"classifier"`` for classifiers and ``"regressor"`` for -regressors and ``"clusterer"`` for clustering methods, to work as expected. -Inheriting from ``ClassifierMixin``, ``RegressorMixin`` or ``ClusterMixin`` +This value should have the following values to work as expected: + +- ``"classifier"`` for classifiers +- ``"regressor"`` for regressors +- ``"clusterer"`` for clustering methods +- ``"outlier_detector"`` for outlier detectors. +- ``"DensityEstimator"`` for density estimators. + +Inheriting from ``ClassifierMixin``, ``RegressorMixin``, ``ClusterMixin``, +``DensityEstimator`` or ``OutlierMixin``, will set the attribute automatically. When a meta-estimator needs to distinguish among estimator types, instead of checking ``_estimator_type`` directly, helpers like :func:`base.is_classifier` should be used. From d105a7d0c176fb61462a43e8abcdcd74863c9787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Sat, 28 Sep 2024 14:51:26 +0200 Subject: [PATCH 2/3] DOC: Adding estimator types --- doc/developers/develop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst index a4792fc6c4578..794432db13d4f 100644 --- a/doc/developers/develop.rst +++ b/doc/developers/develop.rst @@ -475,7 +475,7 @@ on a classifier, but not otherwise. Similarly, scorers for average precision that take a continuous prediction need to call ``decision_function`` for classifiers, but ``predict`` for regressors. This distinction between classifiers and regressors is implemented using the ``_estimator_type`` attribute, which takes a string value. -This value should have the following values to work as expected: +This attribute should have the following values to work as expected: - ``"classifier"`` for classifiers - ``"regressor"`` for regressors From 10278ac323da553d83e0f54a9016379195f511a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Mon, 14 Oct 2024 10:28:13 +0200 Subject: [PATCH 3/3] added links to classes, corrected one class name --- doc/developers/develop.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst index 794432db13d4f..606df429340aa 100644 --- a/doc/developers/develop.rst +++ b/doc/developers/develop.rst @@ -480,11 +480,11 @@ This attribute should have the following values to work as expected: - ``"classifier"`` for classifiers - ``"regressor"`` for regressors - ``"clusterer"`` for clustering methods -- ``"outlier_detector"`` for outlier detectors. -- ``"DensityEstimator"`` for density estimators. +- ``"outlier_detector"`` for outlier detectors +- ``"DensityEstimator"`` for density estimators -Inheriting from ``ClassifierMixin``, ``RegressorMixin``, ``ClusterMixin``, -``DensityEstimator`` or ``OutlierMixin``, +Inheriting from :class:`~base.ClassifierMixin`, :class:`~base.RegressorMixin`, :class:`~base.ClusterMixin`, +:class:`~base.OutlierMixin` or :class:`~base.DensityMixin`, will set the attribute automatically. When a meta-estimator needs to distinguish among estimator types, instead of checking ``_estimator_type`` directly, helpers like :func:`base.is_classifier` should be used.