edsteva.metrics.error_between_t0_t1
error_between_t0_t1
error_between_t0_t1(
predictor: pd.DataFrame,
estimates: pd.DataFrame,
index: List[str],
loss_function: Callable = loss_functions.l2_loss,
y: str = "c",
y_0: str = "c_0",
t_0: str = "t_0",
t_1: str = "t_1",
x: str = "date",
name: str = "error",
)
Compute the error between the predictor \(c(t)\) and the prediction \(\hat{c}(t)\) after \(t_0\) as follow:
Where the loss function \(\mathcal{l}\) can be the L1 distance or the L2 distance.
PARAMETER | DESCRIPTION |
---|---|
predictor |
\(c(t)\) computed in the Probe
TYPE:
|
estimates |
\(\hat{c}(t)\) computed in the Model
TYPE:
|
index |
Variable from which data is grouped
TYPE:
|
loss_function |
The loss function \(\mathcal{l}\)
TYPE:
|
y |
Column name for the completeness variable \(c(t)\)
TYPE:
|
y_0 |
Column name for the predicted completeness variable \(\hat{c}(t)\)
TYPE:
|
t_0 |
Column name for the predicted threshold \(t_0\)
TYPE:
|
t_1 |
Column name for the predicted threshold \(t_1\)
TYPE:
|
x |
Column name for the time variable \(t\)
TYPE:
|
name |
Column name for the metric output
TYPE:
|
Example
care_site_level | care_site_id | stay_type | error |
---|---|---|---|
Unité Fonctionnelle (UF) | 8312056386 | 'Urg' | 0.040 |
Unité Fonctionnelle (UF) | 8312056386 | 'All' | 0.028 |
Pôle/DMU | 8312027648 | 'Urg' | 0.022 |
Pôle/DMU | 8312027648 | 'All' | 0.014 |
Hôpital | 8312022130 | 'Urg' | 0.027 |
Source code in edsteva/metrics/error_between_t0_t1.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 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 |
|