Skip to content

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

@MarkBusschers

Description

@MarkBusschers

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions