tempor.methods.treatments.temporal package

Subpackages

Module contents

Temporal treatment effect estimation methods, that is, the treatment is a time-series.

class tempor.methods.treatments.temporal.BaseTemporalTreatmentEffects(**params: Any)[source]

Bases: BasePredictor

Abstract base class for all predictors.

Defines some core methods, primarily: - predict: Predicts the target variable for the given data. - predict_proba: Predicts the probability of the target variable for the given data. - predict_counterfactuals: Predicts the counterfactuals for the given data. - The _ versions of the above methods are the implementations of the above methods in the derived classes.

fit(data: BaseDataset, *args: Any, **kwargs: Any) Self[source]

Fit the method to the data.

Parameters:
data : dataset.BaseDataset

The dataset to fit the model to.

*args : Any

Additional arguments to pass to the _fit method.

**kwargs : Any

Additional keyword arguments to pass to the _fit method.

Returns:

The fitted model.

Return type:

Self

predict(data: PredictiveDataset, *args: Any, **kwargs: Any) TimeSeriesSamplesBase[source]

Predicts the target variable for the given data.

Parameters:
data : dataset.PredictiveDataset

The dataset to predict on.

*args : Any

Additional positional arguments passed to the implementation (_predict).

**kwargs : Any

Additional keyword arguments passed to the implementation (_predict).

Returns:

The predictions.

Return type:

Any

predict_counterfactuals(data: PredictiveDataset, *args: Any, **kwargs: Any) list[source]

Predict counterfactuals for the given data.

Parameters:
data : dataset.PredictiveDataset

Data to predict counterfactuals for.

*args : Any

Additional positional arguments.

**kwargs : Any

Additional keyword arguments.

Returns:

List of counterfactual predictions.

Return type:

List