Context
PR #79's Gate B found that sklearn.base.clone() under scikit-learn 1.2.2 fails for 26 public estimators because constructors normalize or defensively copy public parameters. The same failures reproduce on base SHA a4879fb, so this is pre-existing compatibility debt rather than a PR #79 regression.
The current regression test is version-limited and marked strict=True XFAIL for scikit-learn <1.3.
Goal
Restore legacy sklearn clone compatibility without weakening validation or changing normalized runtime behavior.
Required design
- preserve each public constructor argument exactly on the public attribute expected by
get_params(deep=False);
- place canonicalized/validated values in private attributes, for example
solver plus _solver_normalized;
- avoid
str(), .lower(), bool(), int(), float(), list(), dict(), or np.asarray() replacement of public constructor attributes inside __init__;
- ensure
set_params() refreshes private normalized state;
- retain
__sklearn_clone__ for newer sklearn while also satisfying the legacy constructor identity check;
- centralize choice normalization and alias handling in shared helpers.
Work plan
- Generate a structured mismatch report for all public estimators and parameters.
- Group failures by normalization/copy pattern.
- Refactor shared bases and validators first.
- Update estimator families in small batches.
- Test clone, nested clone, pipelines, grid search, mutable parameters, and absence of fitted state.
Compatibility matrix
- scikit-learn 1.2.2;
- scikit-learn 1.3.x;
- latest supported scikit-learn.
Acceptance criteria
test_all_default_public_estimators_clone passes without XFAIL on all supported sklearn versions;
get_params/set_params semantics remain stable;
- normalized estimator behavior and error validation remain unchanged;
- complete CPU and physical-GPU suites pass.
Relationship
Follow-up to PR #79. This is non-blocking for the GPU correctness and finite-input paths validated there.
Context
PR #79's Gate B found that
sklearn.base.clone()under scikit-learn 1.2.2 fails for 26 public estimators because constructors normalize or defensively copy public parameters. The same failures reproduce on base SHAa4879fb, so this is pre-existing compatibility debt rather than a PR #79 regression.The current regression test is version-limited and marked
strict=TrueXFAIL for scikit-learn <1.3.Goal
Restore legacy sklearn clone compatibility without weakening validation or changing normalized runtime behavior.
Required design
get_params(deep=False);solverplus_solver_normalized;str(),.lower(),bool(),int(),float(),list(),dict(), ornp.asarray()replacement of public constructor attributes inside__init__;set_params()refreshes private normalized state;__sklearn_clone__for newer sklearn while also satisfying the legacy constructor identity check;Work plan
Compatibility matrix
Acceptance criteria
test_all_default_public_estimators_clonepasses without XFAIL on all supported sklearn versions;get_params/set_paramssemantics remain stable;Relationship
Follow-up to PR #79. This is non-blocking for the GPU correctness and finite-input paths validated there.