This raises an error that the user cannot do anything about, since instead we should internally set_ fit_request:
import numpy as np
from sklearn.compose import TransformedTargetRegressor
from sklearn.utils._metadata_requests import process_routing
print(process_routing(TransformedTargetRegressor(), "fit", sample_weight=np.array([1,1,2])))
I would like to investigate and make a PR to fix.