cleverly.learners.DensityDiagnostics#

class cleverly.learners.DensityDiagnostics(n_bins: int, edges: ndarray[tuple[Any, ...], dtype[float64]], min_density: float, integrated: tuple[float, float], learner: tuple[SuperLearnerDiagnostics, ...] = ())[source]#

What the density fit looked like, for the report and for the positivity check.

Parameters:
n_binsint

Bins actually used, after duplicate quantiles were dropped.

edgesndarray

The bin boundaries.

min_densityfloat

Smallest \(\hat g(A_i \mid W_i)\) over the sample. The denominator of every clever covariate, so the number a positivity problem shows up in first.

integratedtuple of float

(min, max) of \(\int \hat g(a \mid W_i)\,da\) over rows. Both should be one to machine precision; anything else is a bug in the hazard product, not a modelling matter.

learnertuple of SuperLearnerDiagnostics

Per-fold Super Learner diagnostics, empty when the learner is not an ensemble.

Methods#

Attributes#

DensityDiagnostics.learner: tuple[SuperLearnerDiagnostics, ...] = ()#
DensityDiagnostics.n_bins: int#
DensityDiagnostics.edges: ndarray[tuple[Any, ...], dtype[float64]]#
DensityDiagnostics.min_density: float#
DensityDiagnostics.integrated: tuple[float, float]#