Spaces:
Running
Running
update app.py, add choice button for VisionTSpp base and large
Browse files
app.py
CHANGED
|
@@ -221,12 +221,18 @@ def visual_ts_with_quantiles(true_data, pred_median, pred_quantiles_list, model_
|
|
| 221 |
# pred_range = np.arange(context_len, context_len + pred_len)
|
| 222 |
pred_range = np.arange(context_len-1, context_len + pred_len)
|
| 223 |
|
| 224 |
-
|
|
|
|
|
|
|
| 225 |
|
| 226 |
for j in range(num_bands):
|
| 227 |
lower_quantile_pred, upper_quantile_pred = quantile_preds[j][:, i], quantile_preds[-(j+1)][:, i]
|
|
|
|
|
|
|
|
|
|
| 228 |
q_low, q_high = quantile_vals[j], quantile_vals[-(j+1)]
|
| 229 |
-
ax.fill_between(pred_range,
|
|
|
|
| 230 |
|
| 231 |
y_min, y_max = ax.get_ylim()
|
| 232 |
# ax.vlines(x=context_len, ymin=y_min, ymax=y_max, colors='gray', linestyles='--', alpha=0.7)
|
|
|
|
| 221 |
# pred_range = np.arange(context_len, context_len + pred_len)
|
| 222 |
pred_range = np.arange(context_len-1, context_len + pred_len)
|
| 223 |
|
| 224 |
+
pred_median_visual = true_data[context_len-1:context_len, i] + pred_median[:, i]
|
| 225 |
+
ax.plot(pred_range, pred_median_visual, label='Prediction (Median)', color='red', linewidth=1.5)
|
| 226 |
+
# ax.plot(pred_range, pred_median[:, i], label='Prediction (Median)', color='red', linewidth=1.5)
|
| 227 |
|
| 228 |
for j in range(num_bands):
|
| 229 |
lower_quantile_pred, upper_quantile_pred = quantile_preds[j][:, i], quantile_preds[-(j+1)][:, i]
|
| 230 |
+
lower_quantile_pred_visual = true_data[context_len-1:context_len, i] + lower_quantile_pred
|
| 231 |
+
upper_quantile_pred_visual = true_data[context_len-1:context_len, i] + upper_quantile_pred
|
| 232 |
+
|
| 233 |
q_low, q_high = quantile_vals[j], quantile_vals[-(j+1)]
|
| 234 |
+
ax.fill_between(pred_range, lower_quantile_pred_visual, upper_quantile_pred_visual, color=quantile_colors[j], alpha=0.7, label=f'{int(q_low*100)}-{int(q_high*100)}% Quantile')
|
| 235 |
+
# ax.fill_between(pred_range, lower_quantile_pred, upper_quantile_pred, color=quantile_colors[j], alpha=0.7, label=f'{int(q_low*100)}-{int(q_high*100)}% Quantile')
|
| 236 |
|
| 237 |
y_min, y_max = ax.get_ylim()
|
| 238 |
# ax.vlines(x=context_len, ymin=y_min, ymax=y_max, colors='gray', linestyles='--', alpha=0.7)
|