You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finally Estimator tags are merged (#6599, #8022) but there's still a lot to do.
We need to decide which tags to add and also use the tags more in the tests.
The following tags were proposed and I think might be useful:
supports sparse data
binary-only classifier
multi-label only classifier
positive data only
supports inverse transform?
support sample weights?
1d inputs only?
The X_types field is not really thought through and we need to come up with a more general mechanism to generate input data for an estimator for testing.
We might also want to remove the _pairwise property and replace it by a tag.
It was just proposed to me that we should have a tag for whether something takes y in fit at all. We kind of have the _estimator_type which is related, but also not really thought-through. We should maybe remove _estimator type and have something more coherent as tags.
We could have all tags be boolean and have "supports_y_1d_regression" "supports_y_nd_regressor", "supports_multilabel", "supports_binary_classification" etc but that seems pretty verbose and also means that tags will often be True, while right now all tags are mostly False.
This issue is kind of similar to the X_types.
Most of the suggestions in the original list seem to be covered now, except for "supports sample weights" AFAICT.
Another one which could be useful IMO is a transformer tag to indicate if it outputs sparse data; from what I can tell currently it is only possible to know if sparse data is supported as input
thank you @thomasjpfan , yes something like that , maybe an OutputTags.sparse which could be "always", "never", "same as input", or "maybe 🤷" when we really cannot know in advance -- for example a ColumnTransformer with 0 < sparse_threshold < 1
One use-case I have in mind is: I am given an transformer by a user (in a third-party library, skrub ) and I call set_output on it so that it produces dataframes. I would like to know in advance if there is a risk it produces a sparse matrix and not do set_output in this case.
(For that specific use-case it could also be solved, perhaps more robustly, by having an option to set_output that makes it less strict / allows it to give up on converting the output when it is sparse instead of raising an error, but that is less relevant to this issue. And I think there may be other situations where it is useful to know in advance if a transformer can output sparse data, definitely does, or definitely does not)
Activity
amueller commentedon Mar 12, 2019
It was just proposed to me that we should have a tag for whether something takes
yin fit at all. We kind of have the_estimator_typewhich is related, but also not really thought-through. We should maybe remove_estimatortype and have something more coherent as tags.We could have all tags be boolean and have "supports_y_1d_regression" "supports_y_nd_regressor", "supports_multilabel", "supports_binary_classification" etc but that seems pretty verbose and also means that tags will often be True, while right now all tags are mostly False.
This issue is kind of similar to the
X_types.azrdev commentedon May 3, 2019
I suspect related to these are y-only transformers (see SLEP001: Transformers that modify their target)?
reifba commentedon Oct 4, 2019
I think that adding, a tag of idempotency can tighten and help the estimator checks when building estimators.
if should support something like:
StandardScaleris one such estimator.jeromedockes commentedon Jun 5, 2026
Most of the suggestions in the original list seem to be covered now, except for "supports sample weights" AFAICT.
Another one which could be useful IMO is a transformer tag to indicate if it outputs sparse data; from what I can tell currently it is only possible to know if sparse data is supported as input
thomasjpfan commentedon Jun 6, 2026
Is the proposal to add a
output_tagssomewhat like a InputTags?There are some variations with such an output tag:
OneHotEncoder(sparse_output=True)will always output sparse data. In this case, the output tag can be restricted to sparse.StandardScalar(with_mean=False)returns sparse or dense data dependent on the input. Should the output tag input both dense and sparse output?jeromedockes commentedon Jun 8, 2026
thank you @thomasjpfan , yes something like that , maybe an
OutputTags.sparsewhich could be "always", "never", "same as input", or "maybe 🤷" when we really cannot know in advance -- for example a ColumnTransformer with 0 < sparse_threshold < 1One use-case I have in mind is: I am given an transformer by a user (in a third-party library, skrub ) and I call
set_outputon it so that it produces dataframes. I would like to know in advance if there is a risk it produces a sparse matrix and not doset_outputin this case.(For that specific use-case it could also be solved, perhaps more robustly, by having an option to set_output that makes it less strict / allows it to give up on converting the output when it is sparse instead of raising an error, but that is less relevant to this issue. And I think there may be other situations where it is useful to know in advance if a transformer can output sparse data, definitely does, or definitely does not)