tempor.methods.treatments.one_off package¶
Subpackages¶
Module contents¶
One-off treatment effect estimation methods, that is, the treatment is a one-off event.
- class tempor.methods.treatments.one_off.BaseOneOffTreatmentEffects(**params: Any)[source]¶
Bases:
BasePredictorAbstract 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
_fitmethod.- **kwargs : Any
Additional keyword arguments to pass to the
_fitmethod.
- Returns:¶
The fitted model.
- Return type:¶
Self
- predict(data: PredictiveDataset, *args: Any, **kwargs: Any) StaticSamplesBase[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¶
Input data.
- *args : Any
Additional arguments.
- **kwargs : Any
Additional keyword arguments.
- Returns:¶
List of counterfactual predictions.
- Return type:¶
List