mini_causal.causality.CausalModels

class mini_causal.causality.CausalModels(first_model, second_model)

CausalModels class implementation.

The class is mainly deisgned to implement and include Classification and Regression models of all kinds. 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

average_causal_effect

the effect of the feature on the predictions or outcomes.

Type:

float

average_causal_effect_resid

the average causal effect of the feature on the residuals.

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.