scikit-learn-contrib / MAPIE

A scikit-learn-compatible module to estimate prediction intervals and control risks based on conformal predictions.
https://mapie.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.2k stars 99 forks source link

Issue in flow of ts-changepoint notebook #475

Open LacombeLouis opened 4 days ago

LacombeLouis commented 4 days ago

Describe the bug I get an error when running the ts-changepoint notebook. It looks like an issue with the flow of the notebook and not an issue with the conformal predictor itself.

To Reproduce

Expected behavior

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[23], [line 25](vscode-notebook-cell:?execution_count=23&line=25)
     [15](vscode-notebook-cell:?execution_count=23&line=15)     (
     [16](vscode-notebook-cell:?execution_count=23&line=16)         y_pred_pfit[step:step + gap],
     [17](vscode-notebook-cell:?execution_count=23&line=17)         y_pis_pfit[step:step + gap, :, :],
   (...)
     [22](vscode-notebook-cell:?execution_count=23&line=22)         optimize_beta=True
     [23](vscode-notebook-cell:?execution_count=23&line=23)     )
     [24](vscode-notebook-cell:?execution_count=23&line=24)     conformity_scores_pfit.append(mapie_enbpi.conformity_scores_)
---> [25](vscode-notebook-cell:?execution_count=23&line=25)     lower_quantiles_pfit.append(mapie_enbpi.lower_quantiles_)
     [26](vscode-notebook-cell:?execution_count=23&line=26)     higher_quantiles_pfit.append(mapie_enbpi.higher_quantiles_)
     [27](vscode-notebook-cell:?execution_count=23&line=27) coverage_pfit = regression_coverage_score(
     [28](vscode-notebook-cell:?execution_count=23&line=28)     y_test, y_pis_pfit[:, 0, 0], y_pis_pfit[:, 1, 0]
     [29](vscode-notebook-cell:?execution_count=23&line=29) )

AttributeError: 'MapieTimeSeriesRegressor' object has no attribute 'lower_quantiles_'

Screenshots

Screenshot 2024-07-01 at 11 45 01