causal_testing.specification.variable
This module contains the Variable abstract class, as well as its concrete extensions: Input, Output and Meta.
Module Contents
Classes
An abstract class representing causal variables. |
|
An extension of the Variable class representing inputs. |
|
An extension of the Variable class representing outputs. |
|
An extension of the Variable class representing metavariables. These are variables which are relevant to the |
Attributes
- causal_testing.specification.variable.T
- class causal_testing.specification.variable.Variable(name: str, datatype: T, distribution: scipy.stats._distn_infrastructure.rv_generic = None, hidden: bool = False)
Bases:
abc.ABCAn abstract class representing causal variables.
- Parameters:
name (str) – The name of the variable.
datatype (T) – The datatype of the variable.
distribution (rv_generic) – The expected distribution of the variable values.
- Attr name:
- Attr datatype:
- Attr distribution:
- Attr hidden:
- name: str
- datatype: T
- distribution: scipy.stats._distn_infrastructure.rv_generic
- __repr__()
Return repr(self).
- typestring() str
Return the type of the Variable, e.g. INPUT, or OUTPUT. Note that this is NOT the datatype (int, str, etc.).
- Returns:
A string representing the variable Type.
- Return type:
str
- class causal_testing.specification.variable.Input(name: str, datatype: T, distribution: scipy.stats._distn_infrastructure.rv_generic = None, hidden: bool = False)
Bases:
VariableAn extension of the Variable class representing inputs.
- class causal_testing.specification.variable.Output(name: str, datatype: T, distribution: scipy.stats._distn_infrastructure.rv_generic = None, hidden: bool = False)
Bases:
VariableAn extension of the Variable class representing outputs.
- class causal_testing.specification.variable.Meta(name: str, datatype: T, populate: collections.abc.Callable[[pandas.DataFrame], pandas.DataFrame])
Bases:
VariableAn extension of the Variable class representing metavariables. These are variables which are relevant to the _causal_ structure and properties we may want to test, but are not directly related to the computational model either as inputs or outputs.
- Parameters:
name (str) – The name of the variable.
datatype (T) – The datatype of the variable.
populate (Callable[[DataFrame], DataFrame]) – Populate a given dataframe containing runtime data with the metavariable values as calculated from model inputs and ouputs.
- Attr populate:
The populate function.
- populate: collections.abc.Callable[[pandas.DataFrame], pandas.DataFrame]