causal_testing.testing.causal_effect

This module contains the CausalEffect abstract class, as well as the concrete extension classes: ExactValue, Positive, Negative, SomeEffect, NoEffect

Module Contents

Classes

CausalEffect

An abstract class representing an expected causal effect.

SomeEffect

An extension of CausalEffect representing that the expected causal effect should not be zero.

NoEffect

An extension of CausalEffect representing that the expected causal effect should be zero.

ExactValue

An extension of CausalEffect representing that the expected causal effect should be a specific value.

Positive

An extension of CausalEffect representing that the expected causal effect should be positive.

Negative

An extension of CausalEffect representing that the expected causal effect should be negative.

class causal_testing.testing.causal_effect.CausalEffect

Bases: abc.ABC

An abstract class representing an expected causal effect.

abstract apply(res: causal_testing.testing.causal_test_result.CausalTestResult) bool

Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met

__str__() str

Return str(self).

class causal_testing.testing.causal_effect.SomeEffect

Bases: CausalEffect

An extension of CausalEffect representing that the expected causal effect should not be zero.

apply(res: causal_testing.testing.causal_test_result.CausalTestResult) bool

Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met

class causal_testing.testing.causal_effect.NoEffect(atol: float = 1e-10, ctol: float = 0.05)

Bases: CausalEffect

An extension of CausalEffect representing that the expected causal effect should be zero. :param atol: Arithmetic tolerance. The test will pass if the absolute value of the causal effect is less than atol. :param ctol: Categorical tolerance. The test will pass if this proportion of categories pass.

apply(res: causal_testing.testing.causal_test_result.CausalTestResult) bool

Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met

class causal_testing.testing.causal_effect.ExactValue(value: float, atol: float = None, ci_low: float = None, ci_high: float = None)

Bases: CausalEffect

An extension of CausalEffect representing that the expected causal effect should be a specific value.

apply(res: causal_testing.testing.causal_test_result.CausalTestResult) bool

Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met

__str__()

Return str(self).

class causal_testing.testing.causal_effect.Positive

Bases: SomeEffect

An extension of CausalEffect representing that the expected causal effect should be positive. Currently only single values are supported for the test value

apply(res: causal_testing.testing.causal_test_result.CausalTestResult) bool

Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met

class causal_testing.testing.causal_effect.Negative

Bases: SomeEffect

An extension of CausalEffect representing that the expected causal effect should be negative. Currently only single values are supported for the test value

apply(res: causal_testing.testing.causal_test_result.CausalTestResult) bool

Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met