edsteva.metrics.error
error
error(
predictor: pd.DataFrame,
estimates: pd.DataFrame,
index: List[str],
loss_function: Callable = loss_functions.l2_loss,
y: str = "c",
y_0: str = "c_0",
x: str = "date",
name: str = "error",
)
Compute the error between the predictor \(c(t)\) and the prediction \(\hat{c}(t)\) 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 |
Target column name of \(c(t)\)
TYPE:
|
y_0 |
Target column name of \(\hat{c}(t)\)
TYPE:
|
x |
Target column name of \(t\)
TYPE:
|
name |
Column name of the output
TYPE:
|
Example
care_site_level | care_site_id | stay_type | error |
---|---|---|---|
Unité Fonctionnelle (UF) | 8312056386 | 'Urg_Hospit' | 0.040 |
Unité Fonctionnelle (UF) | 8312056386 | 'All' | 0.028 |
Pôle/DMU | 8312027648 | 'Urg_Hospit' | 0.022 |
Pôle/DMU | 8312027648 | 'All' | 0.014 |
Hôpital | 8312022130 | 'Urg_Hospit' | 0.027 |
Source code in edsteva/metrics/error.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 |
|