cleverly.EstimationMethod#

class cleverly.EstimationMethod(*args, **kwargs)[source]#

Define the contract for an evidenced estimation method.

Parameters:
*args, **kwargs

Present because typing.runtime_checkable() gives a protocol a synthetic constructor. A protocol is implemented, not instantiated.

Attributes:
namestr

Return the stable method name.

See also

TMLEMethod

The analytic point-treatment implementation.

CollaborativeTMLEMethod

Adds collaborative treatment-mechanism selection.

DRTMLEMethod

Adds the reduced-dimension doubly robust correction.

cleverly.IdentifiedEffect

What a method is handed to in order to fit.

Examples

Every shipped method satisfies the protocol, so application code can accept any of them and read the same members:

>>> from cleverly import DRTMLEMethod, EstimationMethod, TMLEMethod
>>> methods = [TMLEMethod(), DRTMLEMethod()]
>>> [method.name for method in methods]
['tmle', 'drtmle']
>>> all(isinstance(method, EstimationMethod) for method in methods)
True

Methods#

EstimationMethod.estimator_kwargs(*, longitudinal: bool = False) → dict[str, Any][source]#

Translate public configuration into an engine request.

Parameters:
longitudinalbool

Whether to translate for the sequential estimator.

Returns:
dict of str to Any

Validated keyword arguments for the implementation engine.

EstimationMethod.with_overrides(**overrides: Any) → EstimationMethod[source]#

Return a normalized copy after applying convenience options.

Parameters:
**overridesAny

Supported flat configuration shortcuts.

Returns:
EstimationMethod

New immutable method configuration.

Attributes#

EstimationMethod.name#

Return the stable method name.