causal_testing.testing.causal_test_adequacy

This module contains code to measure various aspects of causal test adequacy.

Module Contents

Classes

DAGAdequacy

Measures the adequacy of a given DAG by hos many edges and independences are tested.

DataAdequacy

Measures the adequacy of a given test according to the Fisher kurtosis of the bootstrapped result.

Attributes

logger

causal_testing.testing.causal_test_adequacy.logger
class causal_testing.testing.causal_test_adequacy.DAGAdequacy(causal_dag: causal_testing.specification.causal_dag.CausalDAG, test_suite: list[causal_testing.testing.causal_test_case.CausalTestCase])

Measures the adequacy of a given DAG by hos many edges and independences are tested.

measure_adequacy()

Calculate the adequacy measurement, and populate the dag_adequacy field.

to_dict()

Returns the adequacy object as a dictionary.

class causal_testing.testing.causal_test_adequacy.DataAdequacy(test_case: causal_testing.testing.causal_test_case.CausalTestCase, bootstrap_size: int = 100, group_by=None)

Measures the adequacy of a given test according to the Fisher kurtosis of the bootstrapped result.

  • Positive kurtoses indicate the model doesn’t have enough data so is unstable.

  • Negative kurtoses indicate the model doesn’t have enough data, but is too stable, indicating that the spread of inputs is insufficient.

  • Zero kurtosis is optimal.

measure_adequacy()

Calculate the adequacy measurement, and populate the data_adequacy field.

to_dict()

Returns the adequacy object as a dictionary.