Fix #478: sklearn.clone() drops explicit GAM termsFix clone terms
Fix :- sklearn.clone() dropping explicit GAM terms (#478)
This PR fixes an issue where sklearn.clone() removed explicitly defined GAM terms (e.g., LinearGAM(s(0) + s(1))). The problem occurred because TermList did not expose its internal _terms through get_params(), causing sklearn to reconstruct an empty TermList during cloning.
The fix adds sklearn_clone() to TermList, ensuring sklearn performs a deep copy and preserves the terms.
Regression tests were added to verify that cloning preserves terms, works after fit, keeps default terms="auto" behavior, and allows cloned models to refit correctly. All existing tests pass.
Hi @Karman580 This PR doesnt do what the description says. Please review.
Hi @dswah, thanks for the feedback.You're right , this PR includes changes beyond the clone issue. I’ll clean it up to keep it strictly scoped to #478 and remove unrelated changes.Will update shortly.