auc
AUCScore
¶
Bases: Trace
Compute Area Under the ROC Curve from prediction scores.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
true_key |
str
|
Name of the key that corresponds to ground truth in the batch dictionary. Array-like of shape (n_samples,) or (n_samples, n_classes). The binary and multiclass cases expect labels with shape (n_samples,) while the multilabel case expects binary label indicators with shape (n_samples, n_classes). |
required |
pred_key |
str
|
Name of the key that corresponds to predicted score in the batch dictionary. Array-like of shape (n_samples,) or (n_samples, n_classes) Target scores/Probability estimates. |
required |
mode |
Union[None, str, Iterable[str]]
|
What mode(s) to execute this Trace in. For example, "train", "eval", "test", or "infer". To execute regardless of mode, pass None. To execute in all modes except for a particular one, you can pass an argument like "!infer" or "!train". |
('eval', 'test')
|
ds_id |
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Trace in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|
output_name |
str
|
Name of the key to store back to the state. |
'auc'
|
average |
str
|
{'micro', 'macro', 'samples', 'weighted'} or None,
If |
'macro'
|
sample_weight |
Optional[List[float]]
|
array-like of shape (n_samples,), default=None. Sample weights. |
None
|
max_fpr |
Optional[float]
|
float > 0 and <= 1, default=None
If not |
None
|
multi_class |
{'raise', 'ovr', 'ovo'}, default='raise'
Only used for multiclass targets. Determines the type of configuration to use. The default value raises
an error, so either
|
'raise'
|
|
labels |
array-like of shape (n_classes,), default=None
Only used for multiclass targets. Used to get the missing labels which aren't present in input batch of
|
None
|
|
per_ds |
bool
|
Whether to automatically compute this metric individually for every ds_id it runs on, in addition to
computing an aggregate across all ds_ids on which it runs. This is automatically False if |
True
|
Raises |
ValueError: Expected values of 'max_fpr' should be either None or between 0 and 1. ValueError: Expected values of 'multi_class' are ['raise', 'ovr' or 'ovo']. ValueError: Expected values of 'average' should be either None or ['micro', 'macro', 'samples', 'weighted']. |
required |
Source code in fastestimator/fastestimator/trace/metric/auc.py
27 28 29 30 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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|