Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformalized quantile regression - show_all_PI=True, double column names #1680

Open
MarkBusschers opened this issue Feb 24, 2025 · 0 comments

Comments

@MarkBusschers
Copy link

Hello,
I run the following code:

confidence_lv = 0.9
alpha = 1-confidence_lv
quantile_list = [round((alpha/2), 2), round((confidence_lv + alpha/2), 2)]

n_lags = 96
n_forecasts = 97

model = NeuralProphet(
daily_seasonality=5,
weekly_seasonality=30,
yearly_seasonality=False,
seasonality_mode='additive',
n_changepoints=0,
n_forecasts=n_forecasts,
n_lags=n_lags,
ar_reg = 1,
epochs=100,
quantiles=quantile_list
)

forecast_ci = model.conformal_predict(
test,
calibration_df=calibration,
alpha=alpha,
method=method,
plotting_backend="plotly",
show_all_PI=True,
)

forecast_ci contains double columns for all the conformal quantile regression intervals, e.g. yhat19 5.0% + qhat19. I believe this is caused by the following piece of code, where for e.g. step_number=1, also yhat10, yhat11, yhat12 ... yhat19 are part of df_quantiles.

if show_all_PI:
df_quantiles = [col for col in df_qr.columns if "%" in col and f"yhat{step_number}" in col]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant