Skip to content

API: Estimators

Bases: _DEUPBase, RegressorMixin

Direct Epistemic Uncertainty Prediction for regression.

Parameters:

Name Type Description Default
base_model Any

The regressor whose uncertainty we estimate. Defaults to :class:~sklearn.ensemble.HistGradientBoostingRegressor.

None
error_model Any

Secondary error predictor g. Defaults to HGB regressor.

None
features Any

Optional :class:~deup.core.features.FeaturePipeline for stationarizing features (default: raw X).

None
aleatoric Any

Optional aleatoric estimator a(x) (e.g. :class:~deup.core.aleatoric.Heteroscedastic). When set, predict_epistemic returns max(0, g - a).

None
cv Any

An int (KFold folds) or any splitter with split(X, y, groups).

5
loss Any | None

Error-target loss ("squared" by default).

None
target_transform TargetTransform | None

Stabilization for g's target: "log" (default), "asinh", "none".

None
decompose bool

If True, always apply max(0, g - a) even when aleatoric is None (with a=0 this is a no-op).

False
random_state int | None

Seed when cv is an int.

None

Attributes:

Name Type Description
base_model_, error_estimator_, oof_, aleatoric_

Fitted components.

predict(X, return_uncertainty=False, groups=None)

Predict, optionally returning (prediction, epistemic_uncertainty).

Bases: _DEUPBase, ClassifierMixin

Direct Epistemic Uncertainty Prediction for classification.

Uses predict_proba for OOF error collection and defaults to logloss as the error target.

Parameters:

Name Type Description Default
base_model Any

Classifier whose uncertainty we estimate. Defaults to HGB classifier.

None
loss Any | None

"logloss" (default) or "brier".

None
cv Any

An int (StratifiedKFold) or custom splitter.

5
features Any

Same as :class:DEUPRegressor.

None
aleatoric Any

Same as :class:DEUPRegressor.

None
target_transform Any

Same as :class:DEUPRegressor.

None
error_eps Any

Same as :class:DEUPRegressor.

None
decompose Any

Same as :class:DEUPRegressor.

None
random_state Any

Same as :class:DEUPRegressor.

None

Bases: _DEUPBase, RegressorMixin

Direct Epistemic Uncertainty Prediction for cross-sectional ranking.

Defaults to loss="rank" and residualize_rank=True so the reported signal is decoupled from mechanical rank geometry (Finding 3). Requires groups at fit (e.g. dates). Defaults to :class:~deup.splitters.PurgedWalkForward when cv is an int.

Parameters:

Name Type Description Default
base_model Any

The ranker / regressor whose ordering uncertainty we estimate.

None
residualize_rank bool

If True (default), apply isotonic rank-geometry residualization to g.

True
features Any

Same as :class:DEUPRegressor.

None
aleatoric Any

Same as :class:DEUPRegressor.

None
target_transform Any

Same as :class:DEUPRegressor.

None
error_eps Any

Same as :class:DEUPRegressor.

None
decompose Any

Same as :class:DEUPRegressor.

None
random_state Any

Same as :class:DEUPRegressor.

None
Notes

groups is required at fit(X, y, groups=...) and should be passed to predict(..., groups=...) / predict_epistemic(..., groups=...) at inference for correct within-date residualization.