autora.experimentalist.falsification.utils
align_dataframe_to_ivs(dataframe, independent_variables)
Aligns a dataframe to a metadata object, ensuring that the columns are in the same order as the independent variables in the metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataframe
|
DataFrame
|
a dataframe with columns to align |
required |
independent_variables
|
List[IV]
|
a list of independent variables |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
a dataframe with columns in the same order as the independent variables in the metadata |
Source code in temp_dir/falsification/src/autora/experimentalist/falsification/utils.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
class_to_onehot(y, n_classes=None)
Converts a class vector (integers) to binary class matrix.
E.g. for use with categorical_crossentropy.
Arguments
y: class vector to be converted into a matrix
(integers from 0 to num_classes).
n_classes: total number of classes.
Returns
A binary matrix representation of the input.
Source code in temp_dir/falsification/src/autora/experimentalist/falsification/utils.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
get_iv_limits(reference_conditions, metadata)
Get the limits of the independent variables
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference_conditions
|
ndarray
|
data that the model was trained on |
required |
metadata
|
VariableCollection
|
Meta-data about the dependent and independent variables |
required |
Returns: List of limits for each independent variable
Source code in temp_dir/falsification/src/autora/experimentalist/falsification/utils.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|