Skip to content

[Tree unification 8/9] Serialization + BaseEstimator + check_estimator; drop the monkey-patch #954

Description

@jeongyoonlee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions