FIX allow to check parameters for label transformers
@@ -4079,6 +4079,13 @@ def check_param_validation(name, estimator_orig):
continue
with raises(ValueError, match=match, err_msg=err_msg):
+ if any(
+ X_type.endswith("labels")
+ for X_type in _safe_tags(estimator, key="X_types")
+ ):
+ # The estimator is a label transformer and take only `y`
+ getattr(estimator, method)(y)
+ else:
getattr(estimator, method)(X, y)
# Then, for constraints that are more than a type constraint, check that the
@@ -4100,4 +4107,11 @@ def check_param_validation(name, estimator_orig):
continue
with raises(ValueError, match=match, err_msg=err_msg):
+ if any(
+ X_type.endswith("labels")
+ for X_type in _safe_tags(estimator, key="X_types")
+ ):
+ # The estimator is a label transformer and take only `y`
+ getattr(estimator, method)(y)
+ else:
getattr(estimator, method)(X, y)
