Skip to content

autora.variable

DV dataclass

Bases: Variable

Dependent variable.

Source code in temp_dir/core/src/autora/variable/__init__.py
43
44
45
46
47
48
@dataclass
class DV(Variable):
    """Dependent variable."""

    name: str = "DV"
    variable_label: str = "Dependent Variable"

IV dataclass

Bases: Variable

Independent variable.

Source code in temp_dir/core/src/autora/variable/__init__.py
35
36
37
38
39
40
@dataclass
class IV(Variable):
    """Independent variable."""

    name: str = "IV"
    variable_label: str = "Independent Variable"

IVTrial dataclass

Bases: IV

Experiment trial as independent variable.

Source code in temp_dir/core/src/autora/variable/__init__.py
60
61
62
63
64
65
66
67
68
69
70
71
72
@dataclass
class IVTrial(IV):
    """
    Experiment trial as independent variable.
    """

    name: str = "trial"
    UID: str = ""
    variable_label: str = "Trial"
    units: str = "trials"
    priority: int = 0
    value_range: Tuple[Any, Any] = (0, 10000000)
    value: float = 0

ValueType

Bases: str, Enum

Specifies supported value types supported by Variables.

Source code in temp_dir/core/src/autora/variable/__init__.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class ValueType(str, Enum):
    """Specifies supported value types supported by Variables."""

    BOOLEAN = "boolean"
    INTEGER = "integer"
    REAL = "real"
    SIGMOID = "sigmoid"
    PROBABILITY = "probability"  # single probability
    PROBABILITY_SAMPLE = "probability_sample"  # sample from single probability
    PROBABILITY_DISTRIBUTION = (
        "probability_distribution"  # probability distribution over classes
    )
    CLASS = "class"  # sample from probability distribution over classes

Variable dataclass

Describes an experimental variable: name, type, range, units, and value of a variable.

Source code in temp_dir/core/src/autora/variable/__init__.py
21
22
23
24
25
26
27
28
29
30
31
32
@dataclass
class Variable:
    """Describes an experimental variable: name, type, range, units, and value of a variable."""

    name: str = ""
    value_range: Optional[Tuple[Any, Any]] = None
    allowed_values: Optional[Sequence] = None
    units: str = ""
    type: ValueType = ValueType.REAL
    variable_label: str = ""
    rescale: float = 1
    is_covariate: bool = False

VariableCollection dataclass

Immutable metadata about dependent / independent variables and covariates.

Source code in temp_dir/core/src/autora/variable/__init__.py
51
52
53
54
55
56
57
@dataclass(frozen=True)
class VariableCollection:
    """Immutable metadata about dependent / independent variables and covariates."""

    independent_variables: Sequence[Variable] = field(default_factory=list)
    dependent_variables: Sequence[Variable] = field(default_factory=list)
    covariates: Sequence[Variable] = field(default_factory=list)