You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The breaking change itself: reorder every signature to (X, y, treatment, …) and delete the deprecation shim.
This lands as one change. Once a signature is reordered, existing positional calls break silently — y and treatment are both same-length arrays, so there is no TypeError to catch a swap. A partially flipped package is therefore worse than either end state, and no subset of this checklist may be released on its own.
Blocked by the window-closing issues on #980: the shim's coverage must be final (#981) and CausalML's own callers migrated (#982, #983) before anything moves.
The rule
X, then y, then treatment; every other parameter keeps its relative position. Already implemented as v1_order() in causalml/inference/_arg_order.py and derived per method from that method's own signature — so the target for each method is machine-readable, not hand-maintained. tests/test_fit_arg_order.py::test_v1_order pins it.
Checklist
Meta-learners — BaseSLearner, BaseTLearner, BaseXLearner, BaseRLearner, BaseDRLearner and subclasses (XGBTRegressor, XGBRRegressor, XGBRClassifier, XGBTClassifier, BaseXClassifier, BaseRClassifier, LRSRegressor), plus bootstrap / fit_bootstrap_ensemble
Causal trees and forests — CausalTreeRegressor (fit, fit_predict, estimate_ate, bootstrap, bootstrap_pool), CausalRandomForestRegressor
Uplift trees and forests — UpliftTreeClassifier / _KernelUpliftTreeClassifier, UpliftRandomForestClassifier / _KernelUpliftRandomForestClassifier; resolve the X_val, treatment_val, y_val question from the epic
IV — IVRegressor.fit → (X, y, treatment, w); BaseDRIVLearner.fit / fit_predict / estimate_ate / predict / bootstrap → (X, y, treatment, assignment, …)
Neural estimators — TF and JAX DragonNet, Torch and JAX CEVAE
Standalone — PolicyLearner, TMLELearner
Update every Args: docstring block to match the new order
Delete causalml/inference/_arg_order.py, the __init_subclass__ hook in causalml/inference/serialization.py, and the six @shim_arg_order class decorators
Rewrite tests/test_fit_arg_order.py to assert the new order rather than the deprecation (the file's docstring says to update, not delete, these tests)
Acceptance
inspect.signature(learner.fit).parameters starts X, y, treatment for every learner in the checklist.
No FutureWarning machinery remains; grep for _arg_order, shim_arg_order, _in_arg_order_call is empty.
Full suite green, and the equivalence test that guards against a silent y/treatment swap is retained in flipped form.
Part of #980 (v1.0 M1). Refs #854.
The breaking change itself: reorder every signature to
(X, y, treatment, …)and delete the deprecation shim.This lands as one change. Once a signature is reordered, existing positional calls break silently —
yandtreatmentare both same-length arrays, so there is noTypeErrorto catch a swap. A partially flipped package is therefore worse than either end state, and no subset of this checklist may be released on its own.Blocked by the window-closing issues on #980: the shim's coverage must be final (#981) and CausalML's own callers migrated (#982, #983) before anything moves.
The rule
X, theny, thentreatment; every other parameter keeps its relative position. Already implemented asv1_order()incausalml/inference/_arg_order.pyand derived per method from that method's own signature — so the target for each method is machine-readable, not hand-maintained.tests/test_fit_arg_order.py::test_v1_orderpins it.Checklist
BaseSLearner,BaseTLearner,BaseXLearner,BaseRLearner,BaseDRLearnerand subclasses (XGBTRegressor,XGBRRegressor,XGBRClassifier,XGBTClassifier,BaseXClassifier,BaseRClassifier,LRSRegressor), plusbootstrap/fit_bootstrap_ensembleCausalTreeRegressor(fit,fit_predict,estimate_ate,bootstrap,bootstrap_pool),CausalRandomForestRegressorUpliftTreeClassifier/_KernelUpliftTreeClassifier,UpliftRandomForestClassifier/_KernelUpliftRandomForestClassifier; resolve theX_val, treatment_val, y_valquestion from the epicIVRegressor.fit→(X, y, treatment, w);BaseDRIVLearner.fit/fit_predict/estimate_ate/predict/bootstrap→(X, y, treatment, assignment, …)DragonNet, Torch and JAXCEVAEPolicyLearner,TMLELearnerArgs:docstring block to match the new ordercausalml/inference/_arg_order.py, the__init_subclass__hook incausalml/inference/serialization.py, and the six@shim_arg_orderclass decoratorstests/test_fit_arg_order.pyto assert the new order rather than the deprecation (the file's docstring says to update, not delete, these tests)Acceptance
inspect.signature(learner.fit).parametersstartsX, y, treatmentfor every learner in the checklist.FutureWarningmachinery remains; grep for_arg_order,shim_arg_order,_in_arg_order_callis empty.y/treatmentswap is retained in flipped form.