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
TargetEncoder takes 'cols' parameter but doesn't save to the attribute.
(That transfers to category_encoders.TargetEncoder internally)
But scikit-learn BaseEstimator#get_params() expects that all __init__() parameters will be saved.
So accessing 'cols' raises AttributeError.
@momijiame
Thanks for your report! TargetEncoder in nyaggle does not comply with the interface required by scikit-learn, so I think this should be fixed.
In addition, every keyword argument accepted by __init__ should correspond to an attribute on the instance. Scikit-learn relies on this to find the relevant attributes to set on an estimator when doing model selection. https://scikit-learn.org/stable/developers/develop.html
Abstract
AttributeError
occurs whenTargetEncoder
object passed tostr()
function.This behavior has the potential to become an issue on debugging etc.
How to reproduce
The steps to reproduce are the following.
TargetEncoder
takes 'cols' parameter but doesn't save to the attribute.(That transfers to
category_encoders.TargetEncoder
internally)But scikit-learn
BaseEstimator#get_params()
expects that all__init__()
parameters will be saved.So accessing 'cols' raises
AttributeError
.Environment
The text was updated successfully, but these errors were encountered: