Density estimators model the treatment assignment mechanism rather than the outcome model. In skcausal, the public interface stays intentionally small:
estimator.fit(X, t)
scores = estimator.predict_density(X, t)The documented density estimators take polars.DataFrame inputs for both covariates X and treatment t.
What predict_density Means
skcausal currently exposes two density-like output kinds.
density_kind |
Quantity | Interpretation |
|---|---|---|
"conditional" |
\(p(t \mid x)\) | A conditional treatment density. |
"stabilized" |
\(p(t \mid x) / p(t)\) | A stabilized density ratio on the treatment scale. |
Inspect estimator.get_tag("density_kind") before comparing estimators or choosing an evaluation metric.
Documented Density Components
We support Skpro probabilistic regressors for continuous treatments and scikit-learn classifiers for categorical treatments. Permutation Weighting is the most flexible one for both types of treatments.
SkproDensityEstimator
Use this when you need a proper conditional treatment density from a probabilistic regressor.
PermutationWeighting
Use this when you need a classifier-based stabilized density ratio for any treatment structure.
CompositeFactorizedDensityEstimator
Use this when treatment has multiple columns and you want a factorized or autoregressive density decomposition.
evaluate(...)
Use this when you want cross-validated density scoring with LogLikelihoodMetric() or another explicit metric.
Continuous Estimators In This Guide
| Estimator | Returns | Core idea |
|---|---|---|
SkproDensityEstimator |
Conditional density | Wrap a skpro probabilistic regressor and evaluate its pdf at the supplied treatment values. |
PermutationWeighting |
Stabilized density ratio | Train a classifier to separate observed (X, t) pairs from pairs with permuted treatments. |