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
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
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
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
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
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|