(yaxis, line, std, yticks=None, ylabel=None, xlabel=None, show=False, fill_between=True)
| 162 | |
| 163 | |
| 164 | def height_plot(yaxis, line, std, yticks=None, ylabel=None, xlabel=None, show=False, fill_between=True): |
| 165 | fig, ax = plt.subplots(1) |
| 166 | if "mbe" in xlabel.lower(): |
| 167 | # to better see the bias |
| 168 | ax.plot(np.zeros(yaxis.shape), yaxis, '--', color='grey') |
| 169 | |
| 170 | p = ax.plot(line, yaxis, '-', linewidth=3) |
| 171 | if fill_between: |
| 172 | ax.fill_betweenx(yaxis, line - std, line + std, alpha=0.2) |
| 173 | else: |
| 174 | ax.plot(line - std, yaxis, '--', color=p[0].get_color(), linewidth=1.5) |
| 175 | ax.plot(line + std, yaxis, '--', color=p[0].get_color(), linewidth=1.5) |
| 176 | |
| 177 | xlim = [0, ax.get_xlim()[1]] if 'mae' in xlabel.lower() or 'rmse' in xlabel.lower() else None |
| 178 | set_labels_and_ticks(ax=ax, xlabel=xlabel, xlim=xlim, |
| 179 | yticks=yaxis, ytick_labels=yticks, |
| 180 | ylabel=ylabel, show=show) |
| 181 | |
| 182 | return fig |
| 183 | |
| 184 | |
| 185 | def level_errors(Y_true, Y_preds, epoch): |
no test coverage detected