Skip to content

Commit

Permalink
Update _base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiraly committed Sep 22, 2024
1 parent 4666c65 commit 7bf2637
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion skbase/base/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,8 @@ def _clone(estimator, *, safe=True):
found in :ref:`randomness`.
"""
estimator_type = type(estimator)
# XXX: not handling dictionaries
if estimator_type is dict:
return {k: _clone(v, safe=safe) for k, v in estimator.items()}
if estimator_type in (list, tuple, set, frozenset):
return estimator_type([_clone(e, safe=safe) for e in estimator])
elif not hasattr(estimator, "get_params") or isinstance(estimator, type):
Expand Down

0 comments on commit 7bf2637

Please sign in to comment.