Skip to content

Commit

Permalink
fix_other_conformal_method
Browse files Browse the repository at this point in the history
  • Loading branch information
elephaint committed Oct 15, 2024
1 parent b5aca81 commit 5d2ea22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nbs/utils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@
" cuts = [lv / 100 for lv in level]\n",
" for model in model_names:\n",
" mean = fcst_df[model].to_numpy().ravel()\n",
" scores = cs_df[model].to_numpy().reshape(cs_n_windows, n_series, horizon)\n",
" scores = cs_df[model].to_numpy().reshape(n_series, cs_n_windows, horizon)\n",
" scores = scores.transpose(1, 0, 2)\n",
" # restrict scores to horizon\n",
" scores = scores[:,:,:horizon]\n",
" quantiles = np.quantile(\n",
Expand Down
3 changes: 2 additions & 1 deletion neuralforecast/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ def add_conformal_error_intervals(
cuts = [lv / 100 for lv in level]
for model in model_names:
mean = fcst_df[model].to_numpy().ravel()
scores = cs_df[model].to_numpy().reshape(cs_n_windows, n_series, horizon)
scores = cs_df[model].to_numpy().reshape(n_series, cs_n_windows, horizon)
scores = scores.transpose(1, 0, 2)
# restrict scores to horizon
scores = scores[:, :, :horizon]
quantiles = np.quantile(
Expand Down

0 comments on commit 5d2ea22

Please sign in to comment.