dataclasses module
IndicesInput
¶
Source code in deel\fairsense\utils\dataclasses.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
__init__(model=None, x=None, y_true=None, objective=None, variable_groups=None)
¶
Build an IndiceInput object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
Optional[Callable]
|
function that can be applied on x, that return a series with |
None
|
x |
Optional[DataFrame]
|
a dataframe containing the samples to analyse. |
None
|
y_true |
Optional[DataFrame]
|
a dataframe containing the labels of the samples (in the same order) |
None
|
objective |
Callable
|
one of the target from the utils.fairness_objective module. |
None
|
variable_groups |
List[List[str]]
|
list of list, containing the name of the columns that should be grouped. |
None
|
Source code in deel\fairsense\utils\dataclasses.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
compute_objective(x=None)
¶
Compute the objective, using available data. When objective is y_true, y_true is returned, when objective is y_pred, the model is applied on x, and other objective compute the difference between y_true and y_pred.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
the sample to compute the objective on. When None, |
None
|
Returns:
Type | Description |
---|---|
the value of the objective. |
Source code in deel\fairsense\utils\dataclasses.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
IndicesOutput
¶
Source code in deel\fairsense\utils\dataclasses.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
__init__(values)
¶
Encapsulate the results of the analysis. Every function from the indices
module returns an object of this type.
This object override the +
operator allorw to combine result more easily.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values |
DataFrame
|
a DataFrame containing the values of the indices. When confidence |
required |
Source code in deel\fairsense\utils\dataclasses.py
113 114 115 116 117 118 119 120 121 122 123 |
|