plots
plots
¶
plot_murphy_diagram(y_obs, y_pred, weights=None, *, etas=100, functional='mean', level=0.5, ax=None)
¶
Plot a Murphy diagram.
A Murphy diagram plots the scores of elementary scoring functions ElementaryScore
over a range of their free parameter eta
. This shows, if a model dominates all
others over a wide class of scoring functions or if the ranking is very much
dependent on the choice of scoring function.
See Notes for further details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y_obs |
array-like of shape (n_obs)
|
Observed values of the response variable. For binary classification, y_obs is expected to be in the interval [0, 1]. |
required |
y_pred |
array-like of shape (n_obs) or (n_obs, n_models)
|
Predicted values, e.g. for the conditional expectation of the response,
|
required |
weights |
array-like of shape (n_obs) or None
|
Case weights. |
None
|
etas |
int or array - like
|
If an integer is given, equidistant points between min and max y values are generater. If an array-like is given, those points are used. |
100
|
functional |
str
|
The functional that is induced by the identification function
|
'mean'
|
level |
float
|
The level of the expectile of quantile. (Often called \(\alpha\).)
It must be |
0.5
|
ax |
Axes
|
Axes object to draw the plot onto, otherwise uses the current Axes. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ax |
Either the matplotlib axes or the plotly figure. This is configurable by
setting the |
References
[Ehm2015]
-
W. Ehm, T. Gneiting, A. Jordan, F. Krüger. "Of Quantiles and Expectiles: Consistent Scoring Functions, Choquet Representations, and Forecast Rankings". arxiv:1503.08195.
Source code in src/model_diagnostics/scoring/plots.py
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 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 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|