Object index#

This consolidated autosummary inventory generates the individual object pages used by the categorized API tables.

cleverly.CausalStudy

Validate observed data against an immutable causal-study design.

cleverly.StudyProtocol

Record the scientific protocol that gives a causal question its context.

cleverly.PointTreatment

Declare column roles for a point-treatment study.

cleverly.LongitudinalTreatment

Declare time-ordered roles for a longitudinal study.

cleverly.Repeated

Declare a repeated outcome: one non-absorbing outcome column per time point.

cleverly.TimeToEvent

Declare a baseline treatment with one follow-up time and one event code per unit.

cleverly.LongPanel

Declare a longitudinal study read from a long panel: one row per unit and time.

cleverly.longitudinal.PanelLayout

The long-panel roles a container was built from.

cleverly.longitudinal.LongitudinalData.from_long_panel

Build from a long panel: one row per unit and decision time.

cleverly.longitudinal.LongitudinalData.to_long_panel

Return the long panel this container holds: one row per unit and node.

cleverly.Estimand

Define the public contract for a typed causal question.

cleverly.IdentificationProvider

Convert a causal estimand into an observed-data functional.

cleverly.ExplicitAdjustmentProvider

Identify effects from declared adjustment sets or sequential histories.

cleverly.IdentifiedEffect

Bind an estimand to a functional and its identification assumptions.

cleverly.CausalResult

Define operations shared by fitted causal-result families.

cleverly.estimators.TMLEResult

Store a fitted point-treatment TMLE result.

cleverly.longitudinal.LongitudinalResult

Store estimates and fitted artifacts for longitudinal regimens.

cleverly.fluctuation.Fluctuation

The result of a targeting step.

cleverly.fluctuation.FoldFluctuation

One validation fold's contribution to a cross-validated targeting step.

cleverly.ParameterKey

Describe the structured identity behind a parameter alias.

cleverly.Provenance

Enough to tell whether two results came from the same place.

cleverly.ATE

Compare population counterfactual means against one reference arm.

cleverly.ATT

Compare counterfactual means among units in each comparison arm.

cleverly.ATC

Compare counterfactual means among units in the reference arm.

cleverly.BackdoorMeanContrast

Store a normalized observed-data functional for an estimator adapter.

cleverly.CounterfactualMean

Request counterfactual outcome means by treatment level.

cleverly.NaturalCourseMean

Request the observed-course outcome mean.

cleverly.PopulationAttributableRisk

Request the natural-course risk minus a reference counterfactual risk.

cleverly.PopulationAttributableFraction

Request the preventable fraction relative to the natural-course risk.

cleverly.RiskRatio

Compare counterfactual risks on the ratio scale.

cleverly.OddsRatio

Compare counterfactual odds for a binary outcome.

cleverly.RegimeMean

Request mean outcomes under declared treatment regimens.

cleverly.RegimeContrast

Compare each declared regimen against one reference regimen.

cleverly.LearnedRuleValue

Request the fold-average value of a treatment rule learned inside each training fold.

cleverly.ModifiedTreatmentPolicy

Request mean outcomes under modified treatment policies.

cleverly.ModifiedTreatmentPolicyEffect

Compare modified treatment policies.

cleverly.targets.Interpretation

One causal reading of an identified functional, with the assumptions it adds.

cleverly.IncrementalMean

Request means under incremental propensity-score interventions.

cleverly.IncrementalEffect

Compare incremental propensity-score interventions.

cleverly.MSMProjection

Project counterfactual means onto a marginal structural model.

cleverly.ControlledDirectEffect

Compare treatments while fixing a binary intermediate variable.

cleverly.EstimationMethod

Define the contract for an evidenced estimation method.

cleverly.TMLEMethod

Normalized configuration for the built-in analytic TMLE method.

cleverly.CollaborativeTMLEMethod

Configure collaborative treatment-mechanism selection.

cleverly.DRTMLEMethod

Configure the reduced-dimension DR-TMLE correction.

cleverly.SDRMethod

Configure the sequentially doubly robust longitudinal estimator.

cleverly.IPSIMethod

Configure Kennedy's estimator of incremental propensity-score interventions.

cleverly.GComputationMethod

Configure sequential g-computation of a longitudinal regimen.

cleverly.IPWMethod

Configure sequential inverse probability weighting of a longitudinal regimen.

cleverly.ParametricGFormulaMethod

Configure the parametric g-formula of a longitudinal regimen.

cleverly.ModelSpec

Configure nuisance learning for TMLE methods.

cleverly.CrossFitting

Configure outer and learner-level sample splitting.

cleverly.SplitPlan

Reusable cross-fitting assignments for every repeat.

cleverly.Targeting

Configure fluctuation, nuisance bounds, and solver behavior.

cleverly.Inference

Configure confidence intervals and resampling.

cleverly.Runtime

Configure reproducibility, provenance, and resources.

cleverly.MethodAvailability

Report whether a method can estimate an identified effect.

cleverly.ParameterEstimate

A point estimate with everything needed to do inference on it.

cleverly.AssessmentCapability

Describe whether and how a result supports one assessment operation.

cleverly.AssessmentReport

Collect validation, diagnostics, and sensitivity in one post-fit battery.

cleverly.AssessmentStatus

Status returned by a diagnostic or validation operation.

cleverly.DiagnosticReport

Collect statuses from a combined diagnostic or sensitivity run.

cleverly.ValidationReport

Collect results from the inexpensive validation battery.

cleverly.Replayability

Describe which post-fit actions a saved result can reproduce.

cleverly.VariableImportanceEntry

One candidate exposure's target estimate and declared adjustment set.

cleverly.VariableImportanceResult

Candidate-exposure estimates with multiplicity-adjusted null tests.

cleverly.variable_importance

Estimate one causal importance parameter per candidate exposure.

cleverly.load

Load a complete result from a trusted joblib artifact.

cleverly.SuperLearner

Cross-validated convex ensemble of a library of learners.

cleverly.CleverlyError

Base class for every error raised by cleverly.

cleverly.CapabilityError

A request the package refuses for a reason other than the data alone.

cleverly.DataError

The supplied data violates an assumption the estimator relies on.

cleverly.MethodConfigurationError

An estimation-method declaration is invalid or cannot take effect.

cleverly.NotFittedError

A result was requested from an estimator that has not been fitted.

cleverly.ConvergenceWarning

The targeting step stopped before reaching the requested tolerance.

cleverly.MonteCarloWarning

The simulation error is a large share of a parametric g-formula interval.

cleverly.ParameterSpaceWarning

An estimate left the range of the parameter it estimates.

cleverly.PositivityWarning

Estimated treatment (or missingness) probabilities are near 0 or 1.

cleverly.SparseInfluenceWarning

A few rows carry the influence curve, so the Wald interval may under-cover.

cleverly.VersionMismatchWarning

A saved result was written by a different cleverly version than the one loading it.

cleverly.WeightingWarning

The supplied observation weights may not mean what the estimator assumes.

cleverly.exceptions.Refusal

One refusal: its reason code, the failed condition, and what to do instead.

cleverly.exceptions.RefusalReason

Why the package refuses a request.

cleverly.learners.SuperLearnerDiagnostics

What the ensemble learned, for reporting and validation.

cleverly.learners.CorrelationScreener

scikit-learn selector wrapping screen_by_correlation().

cleverly.learners.ParametricOutcome

An unpenalized logistic GLM of the outcome on a declared feature map.

cleverly.learners.ParametricMechanism

An unpenalized logistic regression of an indicator on a polynomial in logit q.

cleverly.learners.ParametricFitDiagnostics

What one parametric fit reports.

cleverly.learners.CrossFitPlan

The fold policy a fit declared, as distinct from the split it got.

cleverly.learners.Folds

A cross-fitting partition.

cleverly.learners.FoldOrigin

The record of how random_partition() drew one split.

cleverly.learners.ConditionalDensity

An evaluated conditional density: one row of bin probabilities per observation.

cleverly.learners.DensityDiagnostics

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

cleverly.learners.default_library

Return the concrete default ensemble for one prediction task.

cleverly.learners.make_folds

Build a cross-fitting partition of n observations.

cleverly.learners.random_partition

Draw an unstratified split of rows, or of whole clusters, from a seed.

cleverly.learners.thread_limit

Limit native thread pools for the duration of the block.

cleverly.learners.set_thread_limit

Set the native thread limit applied around each nuisance-model fit.

cleverly.learners.get_thread_limit

The thread limit currently applied around each fit.

cleverly.interventions.Intervention

A conditional distribution over the treatment arms.

cleverly.interventions.Static

Set the treatment to one level for everybody: \(g^\star = \mathbb 1\{a = v\}\).

cleverly.interventions.Rule

A dynamic regime: assign \(d(W)\), a deterministic function of the covariates.

cleverly.interventions.Stochastic

A known stochastic regime: assign arm \(a\) with probability \(g^\star(a \mid W)\).

cleverly.longitudinal.DynamicRegimen

A plan whose nodes may be rules rather than constants.

cleverly.longitudinal.each_node

Write one rule for every node, each reading its own node's columns by name.

cleverly.longitudinal.NodeRule

One node of a rule written for every node: calls rule(frame, time).

cleverly.interventions.LearnedRule

Declare the rule whose fold-average value a fit estimates.

cleverly.interventions.LearnedRuleRecord

Record what a learned-rule fit estimated, under result.extra["learned_rule"].

cleverly.interventions.RegimeSet

The regimes a fit targets, and their evaluated densities.

cleverly.interventions.Incremental

Multiply the odds of treatment levels by declared factors.

cleverly.interventions.IPSISet

Every declared tilt, evaluated against the estimated mechanism.

cleverly.interventions.Shift

Add delta to everyone's treatment, up to cap.

cleverly.interventions.Scale

Multiply everyone's dose by factor, up to cap.

cleverly.interventions.DoseQuantile

The cap at a quantile of the natural dose among the units at risk.

cleverly.interventions.SupportBoundary

The cap at a learned conditional quantile of the dose: c(h).

cleverly.interventions.LinearQuantileRegression

A declared linear quantile regression: the boundary beta' (1, features).

cleverly.interventions.Piecewise

A policy that applies a different shift or scale on each interval of the dose.

cleverly.interventions.Piece

One interval of a declared policy and the strictly monotone map it applies there.

cleverly.interventions.Support

The declared conditional support of a continuous dose: [lower(h), upper(h)].

cleverly.interventions.ModifiedPolicy

A modified treatment policy that the analyst declares.

cleverly.interventions.Randomizer

A finite, known law for the randomizer of a randomized policy.

cleverly.interventions.RiskRatioTilt

The risk-ratio incremental intervention of lmtp::ipsi, a randomized policy.

cleverly.interventions.JointPolicy

A modified treatment policy on a vector node, declared one component at a time.

cleverly.interventions.PolicySet

Every declared policy, evaluated on the data and on the estimated mechanism.

cleverly.interventions.SupportReport

RegimeSupport for every regime in a fit, plus the worst case.

cleverly.interventions.RegimeSupport

Overlap for one regime.

cleverly.interventions.IncrementalSupport

Overlap for one tilt -- which for this estimand is a statement, not a warning.

cleverly.interventions.PolicySupport

Overlap for one policy: how hard the density ratio is working, and where it fails.

cleverly.interventions.check_support

Overlap diagnostics for each regime, from the untruncated mechanism.

cleverly.interventions.check_incremental_support

Per-tilt overlap, in the vocabulary the other two axes' reports use.

cleverly.interventions.check_policy_support

Per-policy overlap, in the vocabulary cleverly.interventions.support uses.

cleverly.assessment.SensitivityFacade

Access sensitivity analyses supported by a fitted causal result.

cleverly.sensitivity.PositivityReport

Overlap diagnostics for a fitted TMLE.

cleverly.sensitivity.SensitivityBounds

Bias-adjusted bounds under an assumed confounder strength.

cleverly.sensitivity.SensitivityElements

The ingredients of the bias bound for one estimand.

cleverly.sensitivity.BenchmarkResult

Confounder strengths calibrated against covariates that were observed.

cleverly.sensitivity.ConfounderStrengthGrid

Declare treatment and outcome perturbation strengths.

cleverly.sensitivity.ObservedConfounderCalibration

Record one model-dependent observed-covariate calibration.

cleverly.sensitivity.SimulatedConfoundingCell

Store one strength pair's estimate or structured failure.

cleverly.sensitivity.SimulatedConfoundingResult

Store a qualitative simulated-confounding stress surface.

cleverly.sensitivity.EValue

E-values for a point estimate and the confidence limit nearest the null.

cleverly.sensitivity.positivity_report

Compute overlap diagnostics for a fitted TMLE.

cleverly.sensitivity.truncation_curve

Re-estimate across a grid of truncation bounds.

cleverly.sensitivity.omitted_variable_bounds

Bias-adjusted bounds and robustness values for one estimand.

cleverly.sensitivity.robustness_value

The confounding strength that would explain the effect away.

cleverly.sensitivity.benchmark

Calibrate cf_y and cf_d against observed covariates.

cleverly.sensitivity.evalue.evalue

E-value for a fitted result.

cleverly.sensitivity.missingness_tilt

Estimate under a range of departures from missingness-at-random.

cleverly.sensitivity.tipping_gamma

The tilt at which the conclusion tips.

cleverly.sensitivity.simulated_confounding

Refit a selected parameter across a simulated common-cause strength grid.

cleverly.assessment.DiagnosticsFacade

Access diagnostics supported by a fitted causal result.

cleverly.validation.ScoreCheck

Whether the targeting step solved the score equations it was supposed to.

cleverly.validation.ScoreCheckRow

The score diagnostic for one estimand or one targeted family.

cleverly.validation.NuisanceDiagnostics

Fit quality for every nuisance model in a TMLE fit.

cleverly.validation.NuisanceModelReport

Fit quality for one nuisance model.

cleverly.validation.RepeatSpreadRow

Split sensitivity for one parameter in a repeated cross-fitted result.

cleverly.validation.GaussianNoise

Declare one Gaussian noise law for a generated outcome.

cleverly.validation.GaussianIndependentOutcome

Declare an outcome independent of treatment and adjustment variables.

cleverly.validation.GaussianAdjustmentOutcome

Declare f(W) + effect * A + epsilon with Gaussian noise.

cleverly.validation.RelativeGaussianNoise

Declare mean-zero numeric noise relative to a sampled variable.

cleverly.validation.BootstrapMeasurementError

Declare bootstrap measurement-error validation for adjustment variables.

cleverly.validation.EmpiricalInclusionRule

Declare a two-sided empirical inclusion rule for generated outcomes.

cleverly.validation.EmpiricalRefitRecord

One successful empirical refit.

cleverly.validation.RefutationTest

The outcome of one refutation test.

cleverly.validation.RefutationResult

All refutation tests run on a fit.

cleverly.validation.CoverageStudy

Repeatedly fit an estimator on fresh data and measure bias and coverage.

cleverly.validation.StudyResult

The full output of a CoverageStudy.

cleverly.validation.ReplicationRecord

One estimand from one successful repeated-sampling draw.

cleverly.validation.ReplicationFailure

A replication whose fit failed numerically, kept so the study can be diagnosed.

cleverly.validation.ReplicationCheckpoint

Storage that lets an interrupted CoverageStudy resume.

cleverly.validation.DirectoryCheckpoint

Keep each finished replication of a CoverageStudy as a file in a directory.

cleverly.validation.score_check

Check that targeting solved the score equation.

cleverly.validation.nuisance_diagnostics

Fit diagnostics for every nuisance model in the fit.

cleverly.validation.refute

Run refutation tests against a fitted model.

cleverly.inference.BootstrapResult

Bootstrap draws for every estimand, plus how many replicates failed.

cleverly.inference.SimultaneousBands

Joint confidence bands across several estimands.

cleverly.inference.delta_method

Influence curve of function applied to several estimands.

cleverly.inference.influence_covariance

Covariance matrix across several estimands' influence curves.

cleverly.inference.influence_variance

Variance of an estimator from its influence curve.

cleverly.inference.multiplier_critical_value

The 1 - alpha quantile of the max-t statistic.

cleverly.inference.simultaneous_bands

Joint confidence bands over a set of estimates.

cleverly.inference.run_bootstrap

Run n_replicates full-refit bootstrap replicates.

cleverly.datasets.available

Names of the bundled data-generating processes.

cleverly.datasets.make_linear_ate

Generate point-treatment data with a constant additive effect.

cleverly.datasets.make_nonlinear_ate

Nonlinear nuisance functions and a heterogeneous effect.

cleverly.datasets.make_nonlinear_bounded

Generate a bounded outcome with nonlinear nuisance functions.

cleverly.datasets.make_binary_outcome

A binary outcome with known risks, risk ratio and odds ratio.

cleverly.datasets.make_multi_arm

A three-armed confounded process with known counterfactual means.

cleverly.datasets.make_heterogeneous

A sample whose treated and control populations have genuinely different effects.

cleverly.datasets.make_instrument

Instrument-inflation: a covariate that predicts treatment but not the outcome.

cleverly.datasets.make_shift_dose

A confounded continuous dose with known means under each declared shift.

cleverly.datasets.make_missing_outcome

Missing outcomes, with a missingness mechanism that depends on treatment.

cleverly.datasets.make_missing_outcome_binary

A binary outcome with outcomes missing at random given (A, W).

cleverly.datasets.make_missing_outcome_bounded

Missing outcomes on the known support (0, 1), with a nonlinear outcome mean.

cleverly.datasets.make_cde

Controlled direct effect: the effect of A with Z held fixed.

cleverly.datasets.make_clustered

Clustered data with an unobserved shared effect modifying the treatment effect.

cleverly.datasets.make_biased_sample

A sample selected with known, unequal probabilities from a known population.

cleverly.datasets.make_weak_overlap

A practical positivity violation.

cleverly.datasets.make_longitudinal

Two time points, a binary outcome and (optionally) monotone censoring.

cleverly.datasets.make_longitudinal_survival

Two time points, an absorbing event at each, and monotone censoring.

cleverly.datasets.make_longitudinal_repeated

Three time points, a repeated binary outcome at each, and monotone censoring.

cleverly.datasets.make_longitudinal_competing

Two time points, two competing absorbing causes at each, monotone censoring.

cleverly.datasets.make_longitudinal_weighted

A biased sample of make_longitudinal(), with the design weights that undo it.

cleverly.datasets.make_point_survival

A baseline treatment, a discrete-time event, and dropout at the visits.

cleverly.datasets.point_survival_truth

The exact truth of make_point_survival() under an intervention on \(A\).

cleverly.datasets.navigation_data

Draw the point-treatment program data, with the columns under the program's names.

cleverly.datasets.navigation_protocol

Return the protocol for the standard navigation offer in the tutorial program.

cleverly.datasets.longitudinal_navigation_protocol

Return the protocol for navigation offered at two decisions after discharge.

cleverly.datasets.make_sequential_offers

Draw a weekly-offer campaign as a long panel, with the exact truth of its plans.

cleverly.datasets.offers_truth

Return the exact week-4 full-price share under each plan, and each contrast with no offers.

cleverly.datasets.offers_protocol

Return the protocol of the weekly-offer campaign.

cleverly.datasets.win_back

Return the win-back offer: the discount for a customer who is not engaged, else nothing.

cleverly.datasets.win_back_then_ship

Return the win-back-then-ship offer: the discount if not engaged, else free shipping.

cleverly.datasets.make_sequential_pricing

Draw three monthly renewal prices and the renewal, with the exact truth of the plans.

cleverly.datasets.pricing_truth

Return the exact mean renewal and revenue under each plan, and the effect of each plan.

cleverly.datasets.pricing_protocol

Return the protocol of the monthly renewal-price program.

cleverly.datasets.price_rise

Return the plan that raises each price by factor and keeps the price in the band.