Skip to content

Commit dbe2540

Browse files
committed
Fixed clone
1 parent f7e69c1 commit dbe2540

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tdamapper/_common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,7 @@ def clone(estimator):
146146
:return: A new estimator with the same parameters.
147147
:rtype: A scikit-learn compatible estimator
148148
"""
149-
params = estimator.get_params(deep=False)
150-
return type(estimator)(**params)
149+
params = estimator.get_params(deep=True)
150+
cloned = type(estimator)()
151+
cloned.set_params(**params)
152+
return cloned

0 commit comments

Comments
 (0)