mini_causal.causality.CausalModelsRegression

class mini_causal.causality.CausalModelsRegression(first_model, second_model)

CausalModelsRegression class implementation.

The class is mainly deisgned to cover Regression models for tabular data. The aim is to measure the imapact that one model has on the predictions compared to the second one .

In other words,A/B Testing using causality to measure impact

Parameters:
  • first_model – the first trained model

  • second_model – the second trained model

individual_causal_effects

an array of the individual causal effects for the predictions

Type:

np.ndarray

individual_causal_effects_resid

an array of the individual causal effects for the residuals

Type:

np.ndarray

individual_causal_effects_probs

an array of the individual causal effects for the probabilities

Type:

np.ndarray

average_causal_effect

the average causal effect of the first model

Type:

float

average_causal_effect_resid

the average causal effect of the first model on the residuals

Type:

float

average_causal_effect_probs

the average causal effect of the first model on the predicted probabilities

Type:

float

__init__(first_model, second_model)

Methods

__init__(first_model, second_model)

average_causal_effect(X)

The average difference in the predictions for the two models.

average_causal_effect_resid(X)

The average difference in the effects of the residuals.

individual_causal_effects(X)

The individual causal effects of the predicted outcomes.

individual_causal_effects_resid(X)

The individual causal effects of the residuals.