actableai.intervention package

Submodules

actableai.intervention.config module

actableai.intervention.model module

class actableai.intervention.model.AAIInterventionEffectPredictor(target: str, current_intervention_column: str, common_causes: Optional[List[str]] = None, new_intervention_column: Optional[str] = None, expected_target: Optional[str] = None, causal_cv: Optional[int] = None, causal_hyperparameters: Optional[Dict] = None, cate_alpha: Optional[float] = None, presets: Optional[str] = None, model_directory: Optional[str] = None, num_gpus: Optional[int] = 0, drop_unique: bool = True, drop_useless_features: bool = False, tabpfn_model_directory: Optional[str] = None, cross_validation_hyperparameters: Optional[Dict] = None)

Bases: object

fit(df: pandas.core.frame.DataFrame) actableai.intervention.model.AAIInterventionEffectPredictor
Generate each appropriate models (treatment, outcome and residuals)
then fit the final DML causal model
Parameters
df – DataFrame containing the values to fit on
Returns
Self fitted predictor
Return type
AAIInterventionEffectPredictor
predict(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame

Predict the effect of the treatment on the outcome

Parameters
df – DataFrame containing the values to predict on
Raises
NotFittedError – If this method is called before fit
Returns
DataFrame containing the effect of the treatment on the
outcome
Return type
pd.DataFrame
predict_two_way(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame
Predict effect of the new treatment on the outcome AND predict the treatment
necessary to obtain an expected outcome
Parameters
df – Input DataFrame. NB : Here df can also contain the “expected_outcome”. When the new treatment is set the expected outcome must be nan and when the expected outcome is set the new treatment must be nan
Raises
NotFittedError – If this method is called before fit
Returns
Result containing the expected outcome when the treatment
is not nan and the new treatment when the expected outcome is not nan
Return type
pd.DataFrame

Module contents