It seems like sometimes mutation.py line 159 computes max_depth = params['MAX_TREE_DEPTH'] - new_tree.depth as 0, probably when trying to turn a max depth leaf into a new subtree.
Going by the comment this condition was only supposed to be true when no depth_limit was intended, not with a a 0 remaining depth_limit. Changing the condition to is None identity comparison does this more accurately and has resolved the error for me.
Sometimes this condition causes a RecursionError.
It seems like sometimes mutation.py line 159 computes
max_depth = params['MAX_TREE_DEPTH'] - new_tree.depth
as 0, probably when trying to turn a max depth leaf into a new subtree.Going by the comment this condition was only supposed to be true when no depth_limit was intended, not with a a 0 remaining depth_limit. Changing the condition to
is None
identity comparison does this more accurately and has resolved the error for me.