@mmdanziger:
Seems like because the _feature_functions were calculated based on self in __init__ and then stored in an attribute they became effectively un-deepcopy-able. What was happening was that the deepcopied version would run fit on the fresh learner but then when it came to calculated the feature_functions it would use the old learner which had not been fit and was stored in the _feature_functions attribute.
The root of the problem is having _feature_functions as an attribute at all. It's a light function and only calculated once per predict so the added value of caching is dubious and creates cache invalidation problems. This required removing the attribute and replacing it with a lookup function.
@mmdanziger: Seems like because the
_feature_functions
were calculated based onself
in__init__
and then stored in an attribute they became effectively un-deepcopy-able. What was happening was that the deepcopied version would run fit on the fresh learner but then when it came to calculated thefeature_functions
it would use the old learner which had not been fit and was stored in the_feature_functions
attribute.The root of the problem is having
_feature_functions
as an attribute at all. It's a light function and only calculated once per predict so the added value of caching is dubious and creates cache invalidation problems. This required removing the attribute and replacing it with a lookup function.