Give the kernel-backed uplift classes first-class serialization + BaseEstimator conformance, and delete the import-time monkey-patch.
Depends on the estimator + forest existing (Issues 1–6). This is a direct M1 deliverable (check_estimator conformance + serialization hygiene).
Scope
- New classes inherit
SerializableLearner + BaseDecisionTree / BaseEstimator directly (like the causal classes), so delete the tree/__init__.py monkey-patch of save / load / _is_fitted.
- Add
check_estimator conformance: sklearn __init__ convention (store args verbatim, no logic; build in fit), fit returns self, get_params / clone round-trip.
Verify
test_serialization_extended uplift round-trips (save / load).
check_estimator passes for both uplift classes (tree + forest).
get_params / clone round-trip for both.
Reusable templates
SerializableLearner mixin (inference/serialization.py) as used by the causal classes.
- sklearn
__init__ convention notes in the repo CLAUDE.md ("Reviewing PRs that Make a Class a scikit-learn BaseEstimator").
Part of #945.
Give the kernel-backed uplift classes first-class serialization +
BaseEstimatorconformance, and delete the import-time monkey-patch.Depends on the estimator + forest existing (Issues 1–6). This is a direct M1 deliverable (
check_estimatorconformance + serialization hygiene).Scope
SerializableLearner+BaseDecisionTree/BaseEstimatordirectly (like the causal classes), so delete thetree/__init__.pymonkey-patch ofsave/load/_is_fitted.check_estimatorconformance: sklearn__init__convention (store args verbatim, no logic; build infit),fitreturnsself,get_params/cloneround-trip.Verify
test_serialization_extendeduplift round-trips (save/load).check_estimatorpasses for both uplift classes (tree + forest).get_params/cloneround-trip for both.Reusable templates
SerializableLearnermixin (inference/serialization.py) as used by the causal classes.__init__convention notes in the repoCLAUDE.md("Reviewing PRs that Make a Class a scikit-learn BaseEstimator").Part of #945.