-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: skipping without error when there are no variables to transform #599
Comments
@glevv what do you think about this? |
If I understand it correctly, this will only work for estimators that can |
Not really, since in a case in which there's no columns, a call to |
At the moment, if for example, encoders find that the dataset has no categorical variable, they will raise an error, fail and not perform the encoding. If you set Numerical transformers will also raise an error and fail if they find no numerical variable in the dataset. This was done intentionally. My idea when designing these transformers was to stop users from carrying out encoding methodologies to numerical variables, and numerical transformations to categorical variables, inadvertently.. As a clear example, with the Hence, if a categorical encoder encounters no categorical variable in the dataset, it will fail, because it does not have a suitable input for the transformation. @david-cortes is asking that, instead of failing, they just pass. That is, if no categorical variable is found in the dataset, instead of failing, just carry out fit and transform without modifying the dataset. My concern with that is that, most users will not go into the source code, and some don't even read the documentation. So, if we allow the transformers to pass and do nothing, the users might believe that the transformer worked, whatever that means. Whereas, if we raise an error, we are somehow encouraging them to think what might be going on. @david-cortes is not the first one to request this. Someone else requested that for selectors. See #566 and a little related but not quite #567 |
Transformers in this package have the nice functionality to automatically apply to all variables that are either numerical or categorical depending on what the transformer does if the list of variable names is not supplied.
Sometimes, one wants to perform automated feature selection as steps before or after some transformer, in which case if for example one has a transformer like
MatchCategories
and the selector drops all categorical variables, there will be an error later on in the pipeline as there won't be any columns for the transformer.Would be nice if there could be an option to toggle off erroring on empty variable lists.
The text was updated successfully, but these errors were encountered: