-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Suggesting updates on the doc of sklearn.compose.TransformedTargetRegressor #28473
Copy link
Copy link
Closed
Closed
Copy link
Labels
Description
Describe the issue linked to the documentation
Hi,
We discover an inconsistency issue between documentation and code in the class sklearn.compose.TransformedTargetRegressor. As mentioned in the description of parameter func.
func: function, default=None
Function to apply to y before passing to fit. Cannot be set at the same time as transformer. The function needs to return a 2-dimensional array. If func is None, the function used will be the identity function.
The most relevant piece of source code looks like this:
if self.func is not None and self.inverse_func is None:
raise ValueError(
"When 'func' is provided, 'inverse_func' must also be provided"
)
The error in the code mentioned that when func is provided, inverse_func must also be provided. The constraint is not mentioned in the document.
Could you please check it?
Suggest a potential alternative/fix
Maybe you can add the constraint into the document to avoid unnecessary misuse and extra debug efforts.
Reactions are currently unavailable